Re: Using Expanded Objects other than Arrays from plpgsql
Michel Pelletier <pelletier.michel@gmail.com>
From: Michel Pelletier <pelletier.michel@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Pavel Stehule <pavel.stehule@gmail.com>,
pgsql-hackers@lists.postgresql.org
Date: 2024-11-25T02:02:17Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Allow extension functions to participate in in-place updates.
- c366d2bdba7c 18.0 landed
-
Implement new optimization rule for updates of expanded variables.
- 6c7251db0ce1 18.0 landed
-
Detect whether plpgsql assignment targets are "local" variables.
- 36fb9ef269a0 18.0 landed
-
Preliminary refactoring of plpgsql expression construction.
- a654af21ae52 18.0 landed
-
Refactor pl_funcs.c to provide a usage-independent tree walker.
- 6a7283dd2f1c 18.0 landed
-
Generalize plpgsql's heuristic for importing expanded objects.
- 534d0ea6c2b9 18.0 landed
Attachments
- 0001-Add-example-test-module-for-expanded-objects.patch (text/x-patch) patch 0001
On Tue, Nov 19, 2024 at 12:52 PM Michel Pelletier < pelletier.michel@gmail.com> wrote: > On Tue, Nov 19, 2024 at 11:45 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: > >> Pavel Stehule <pavel.stehule@gmail.com> writes: >> > another position can be src/test/modules - I think so your example is >> > "similar" to plsample >> >> Yeah. I think we've largely adopted the position that contrib should >> contain installable modules that do something potentially useful to >> end-users. A pure skeleton wouldn't be that, but if it's fleshed out >> enough to be test code for some core features then src/test/modules >> could be a reasonable home. >> > > Great! I'll put a patch together that adds the skeleton object to > src/test/modules and I'll write some expected tests that run the expansion > through its paces, when the support function feature happens I'll update it > to include tests for that. > Here's a WIP patch for a pgexpanded example in src/test/modules. The object is very simple and starts with an integer and increments that value every time it is expanded. I added some regression tests that test two sql functions that replicate the expansion issue that I'm seeing with my extension. I considered a more complex data type like a linked list, something that could maybe also showcase subscripting support for expanded objects, but I didn't want to go too far without discussion. -Michel >