Re: [HACKERS] [PATCH] Generic type subscription - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: [HACKERS] [PATCH] Generic type subscription
Date
Msg-id 75018189-bcfe-dbd8-5b75-c81e95ec7b10@BlueTreble.com
Whole thread Raw
In response to Re: [HACKERS] [PATCH] Generic type subscription  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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)



pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: [HACKERS] Checksums by default?
Next
From: Stephen Frost
Date:
Subject: Re: [HACKERS] Checksums by default?