Hi! During work on knn-btree patchset we've faced the need to move functions/operators from contrib to core [1]. In the extension upgrade script we need to use @extschema@ in order to distinguish contrib and core objects. However, it appears to be possible to use @extschema@ only in non-relocatable extensions. Comment in extension.c says: "For a relocatable extension, we needn't do this. There cannot be any need for @extschema@, else it wouldn't be relocatable.". I've explored that we've marked extension as non-relocatable solely to use @extschema@ in script before [2].
So, it appears that comment in extension.c isn't true. There is at least two precedents when relocatable extension needs to use @extschema@. We've marked possibly relocatable extension as non-relocatable once. And we could do it at the second time. Extension relocatability doesn't seem to me much value to sacrifice. But nevertheless should we allow relocatable extension to use @extschema@. Any thoughts? Links. 1. https://www.postgresql.org/message-id/CAPpHfdsWsb9T1eHdX%2Br7wnXbGJKQxSffc8gTGp4ZA2ewP49Hog%40mail.gmail.com 2. https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=de623f33353c96657651f9c3a6c8756616c610e4;hp=0024e348989254d48dc4afe9beab98a6994a791e ------ Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company