Re: [PATCH] Generic type subscription
Jim Nasby <jim.nasby@bluetreble.com>
From: Jim Nasby <Jim.Nasby@BlueTreble.com>
To: Tom Lane <tgl@sss.pgh.pa.us>, Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Artur Zakirov <a.zakirov@postgrespro.ru>, Aleksander Alekseev <a.alekseev@postgrespro.ru>, PostgreSQL-development <pgsql-hackers@postgresql.org>, Victor Wagner <vitus@wagner.pp.ru>, Haribabu
Kommi <kommi.haribabu@gmail.com>
Date: 2017-01-24T00:54:40Z
Lists: pgsql-hackers
On 1/23/17 1:36 PM, Tom Lane wrote: > Is there a way for a function > in an extension to find the OID of one of its sibling functions? Obviously there's regprocedure (or it's C equivalent), but then you're stuck re-computing at runtime. I've messed around with that a bit in an effort to have an extension depend on another extension that allows the user to specify it's schema. If you're already doing metaprogramming it's not an enormous problem... if you're not already doing that it sucks. Trying to make that work in C would be somewhere between impossible and a nightmare. Since this kind of thing affects extensions that depend on extensions, it'd certainly be nice if there was some way to address it. BTW, I actually do use SPI to call one of the reg casts in my variant type, but that's just a hack I used in the beginning and haven't gotten around to replacing. Since there's a static variable that gets set to the relevant OID it's not that bad performance-wise from what I can tell, but I suspect that's not something we want to be recommending to others... -- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture and PostgreSQL Data in Trouble? Get it in Treble! http://BlueTreble.com 855-TREBLE2 (855-873-2532)
Commits
-
Throw error when assigning jsonb scalar instead of a composite object
- aa6e46daf530 14.0 landed
-
Filling array gaps during jsonb subscripting
- 81fcc72e6622 14.0 landed
-
Implementation of subscripting for jsonb
- 676887a3b0b8 14.0 landed
-
Support subscripting of arbitrary types, not only arrays.
- c7aba7c14efd 14.0 landed
-
Remove obsoleted code relating to targetlist SRF evaluation.
- ea15e18677fc 10.0 cited
-
Include <sys/select.h> where needed
- 51c3e9fade76 10.0 cited