Allow relocatable extension to use @extschema@?

From: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Allow relocatable extension to use @extschema@?
Date: 2019-12-03 12:06:09
Message-ID: CAPpHfdvZHbFrHLZ2NX8ToYd7QCV3WJY+Q9vJdCqbrS3XxHQ9Xg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)(dot) 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(at)(dot) 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2019-12-03 12:11:27 Re: fe-utils - share query cancellation code
Previous Message Kyotaro Horiguchi 2019-12-03 11:51:46 Re: [HACKERS] WAL logging problem in 9.4.3?