| From: | Michael Paquier <michael(at)paquier(dot)xyz> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: test_extensible: Test module for extensible nodes and custom sca |
| Date: | 2026-08-31 03:52:03 |
| Message-ID: | E1x0t3y-00000002ptd-0vcj@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
test_extensible: Test module for extensible nodes and custom scans
This commit adds a new test module that implements a CustomScan based on
an ExtensibleNode. These APIs exist in the core code for ages but had
zero coverage. This now covers the read, copy and out routines for
extensible nodes, with SQL function wrappers for each. CustomScan nodes
are tested with callbacks to manipulate the executor, based on the idea
of repeating the number of times each row is returned in a single scan,
using a GUC (default at 2 tuples for each row, can be tweaked).
The code of this module is primitive to keep its logic simpler. For
example, custom scans happen only when matching one specific, hardcoded
relation name, and work only for base relations (this can be extended at
will, as required).
This module can be used as a template for developers willing to develop
their own extensions. "Writing a Custom Scan Provider" covers the
documentation for custom scans.
Author: Aleksander Alekseev <aleksander(at)tigerdata(dot)com>
Reviewed-by: Jan Nidzwetzki <jan(at)planetscale(dot)com>
Reviewed-by: Michael Paquier <michael(at)paquier(dot)xyz>
Reviewed-by: Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAJ7c6TNfn9Fv_Je1etA6rrgq1onVvXbjwBTkbkd4kVQhcu11gg%40mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/0e944fe3579ecd525e5ffe7b7db4a7e1c34de49e
Modified Files
--------------
src/test/modules/Makefile | 1 +
src/test/modules/meson.build | 1 +
src/test/modules/test_extensible/.gitignore | 4 +
src/test/modules/test_extensible/Makefile | 23 +
.../test_extensible/expected/test_extensible.out | 242 +++++++++
src/test/modules/test_extensible/meson.build | 33 ++
.../test_extensible/sql/test_extensible.sql | 83 +++
.../test_extensible/test_extensible--1.0.sql | 25 +
src/test/modules/test_extensible/test_extensible.c | 568 +++++++++++++++++++++
.../test_extensible/test_extensible.control | 4 +
src/tools/pgindent/typedefs.list | 2 +
11 files changed, 986 insertions(+)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Nathan Bossart | 2026-08-31 17:07:41 | pgsql: doc: Drop stale note about extension LWLock names. |
| Previous Message | Nathan Bossart | 2026-08-30 14:41:09 | pgsql: doc: Fix the data type named in the regdatabase entry. |