Re: Allowing extensions to find out the OIDs of their member objects - Mailing list pgsql-hackers

From Andrew Gierth
Subject Re: Allowing extensions to find out the OIDs of their member objects
Date
Msg-id 877eex4hlr.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Allowing extensions to find out the OIDs of their member objects  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Allowing extensions to find out the OIDs of their member objects  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:

 Tom> I thought about extending the extension infrastructure to provide
 Tom> some way of retrieving relevant OIDs. We could imagine, for
 Tom> instance, that an extension script has a way to say "this function
 Tom> is object number three within this extension", and while running
 Tom> the script we make a catalog entry showing that object number
 Tom> three has OID thus-and-so, and then that catalog entry can be
 Tom> consulted to get the right OID (by C code that has hard-wired
 Tom> knowledge that object number three is the function it cares
 Tom> about). This is still kind of messy, because aside from the
 Tom> hand-assigned object numbers you'd have to use the extension name
 Tom> as part of the lookup key, making the name into something the C
 Tom> code critically depends on. We don't have ALTER EXTENSION RENAME,
 Tom> so maybe that's okay, but it seems painful to say that we can
 Tom> never have it.

I suggest using string tags rather than object numbers:

1. easier to read and maintain

2. an object might be given many tags, some of them automatically

3. it might make sense to provide a function that the extension can use
to ask "is oid X one of my objects with tag 'foo'" (e.g. to match one of
a set of related functions) in addition to looking up specific oids by
tag

-- 
Andrew (irc:RhodiumToad)


pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Pluggable Storage - Andres's take
Next
From: Tomas Vondra
Date:
Subject: Re: explain plans with information about (modified) gucs