Re: Using Expanded Objects other than Arrays from plpgsql

From: Michel Pelletier <pelletier(dot)michel(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Using Expanded Objects other than Arrays from plpgsql
Date: 2024-11-25 02:02:17
Message-ID: CACxu=vKqoHGmnuaTehd3Jc7vEMuCktA+F=QHYqqvZGW1am2ASg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Tue, Nov 19, 2024 at 12:52 PM Michel Pelletier <
pelletier(dot)michel(at)gmail(dot)com> wrote:

> On Tue, Nov 19, 2024 at 11:45 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
>> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)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

>

Attachment Content-Type Size
0001-Add-example-test-module-for-expanded-objects.patch text/x-patch 16.1 KB

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Arbol One 2024-11-25 02:15:09 JDBC using REFERENCES
Previous Message Ron Johnson 2024-11-24 22:15:18 Re: Questions on Upgrading PostgreSQL from 15.0 to 15.9 and Setting Up Streaming Replication

Browse pgsql-hackers by date

  From Date Subject
Next Message Sutou Kouhei 2024-11-25 02:06:20 Re: Make COPY format extendable: Extract COPY TO format implementations
Previous Message Noah Misch 2024-11-25 01:24:00 Re: Proper object locking for GRANT/REVOKE