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