Allow relocatable extension to use @extschema@? - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Allow relocatable extension to use @extschema@?
Date
Msg-id CAPpHfdvZHbFrHLZ2NX8ToYd7QCV3WJY+Q9vJdCqbrS3XxHQ9Xg@mail.gmail.com
Whole thread Raw
Responses Re: Allow relocatable extension to use @extschema@?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: [HACKERS] WAL logging problem in 9.4.3?
Next
From: Fabien COELHO
Date:
Subject: Re: fe-utils - share query cancellation code