Simple CustomScan example

Started by Chris Clevelandover 2 years ago3 messages
#1Chris Cleveland
ccleveland@dieselpoint.com

I'm trying to write a custom scan. It's pretty confusing. I've read the
documentation at
https://www.postgresql.org/docs/current/custom-scan.html, and I've scanned
the
code in Citus Columnar and in Timescale, both of which are quite complex.

Is anyone aware of code with a simple example of a custom scan? Or maybe a
tutorial?

--
Chris Cleveland
312-339-2677 mobile

#2Drouvot, Bertrand
bertranddrouvot.pg@gmail.com
In reply to: Chris Cleveland (#1)
Re: Simple CustomScan example

Hi,

On 9/6/23 9:32 PM, Chris Cleveland wrote:

I'm trying to write a custom scan. It's pretty confusing. I've read the documentation at
https://www.postgresql.org/docs/current/custom-scan.html <https://www.postgresql.org/docs/current/custom-scan.html&gt;, and I've scanned the
code in Citus Columnar and in Timescale, both of which are quite complex.

Is anyone aware of code with a simple example of a custom scan?

You may find the one in this repo: https://github.com/bdrouvot/pg_directpaths simple enough.

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

#3Michael Paquier
michael@paquier.xyz
In reply to: Drouvot, Bertrand (#2)
Re: Simple CustomScan example

On Thu, Sep 07, 2023 at 06:29:27PM +0200, Drouvot, Bertrand wrote:

You may find the one in this repo:
https://github.com/bdrouvot/pg_directpaths simple enough.

I'll repeat a remark I have made exactly yesterday on a different
thread: having a test module for custom scans in src/test/modules/ to
test these APIs and have a usable template would be welcome :D
--
Michael