Re: [PATCH] Generic type subscription

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
Cc: Artur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>, Aleksander Alekseev <a(dot)alekseev(at)postgrespro(dot)ru>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Victor Wagner <vitus(at)wagner(dot)pp(dot)ru>, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
Subject: Re: [PATCH] Generic type subscription
Date: 2017-01-24 00:54:40
Message-ID: 75018189-bcfe-dbd8-5b75-c81e95ec7b10@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2017-01-24 00:55:25 Re: Checksums by default?
Previous Message Jim Nasby 2017-01-24 00:39:29 Re: Checksums by default?