On 01/20/19 19:43, Tom Lane wrote: >> If the extension script could somehow be informed at CREATE EXTENSION time >> of what its OID is, that would clear the way for ALTER EXTENSION RENAME, no? > > And it remembers that where?
Top level answer: up to the extension author. Next level answer: maybe not all extensions have libraries to load, but for those that do (a good portion), wouldn't it be convenient for _PG_init() to get the value, either passed as an argument, or through some API? After the extension is created, loading of the library is going to be occasioned through the call of some function, right? That function just got looked up, and it has an 'e' dependency recorded on the extension, giving the extension OID. I can't judge whether that's too much lookup action for the library load machinery to be doing; how frequent are library loads, and how much would that add to the cycles they already require? Regards, -Chap