segasai / q3c

PostgreSQL extension for spatial indexing on a sphere
GNU General Public License v2.0
77 stars 27 forks source link

Moving Q3C to a different schema? #23

Closed rhandberg closed 4 years ago

rhandberg commented 4 years ago

I am trying to move the Q3C extension to a different schema than where it was originally installed, using the following ALTER EXTENSION call:

ALTER EXTENSION q3c SET SCHEMA utils;

But that results in the following error message:

ERROR:  extension "q3c" does not support SET SCHEMA

Turns out that Q3C is installed with relocatable=False, meaning that I can't move it. I could, in principle drop the extension and install it again, but what would require me to drop all the dependencies as well, which I REALLY don't want to do! (billions of rows and a long down-time!)

Is there a reason for Q3C not to be relocatable? If not, should something be changed in the "installer"? Is there a way to move it to a different schema, without dropping the extension?

segasai commented 4 years ago

Hi Rasmus,To be honest I wasn't aware of relocability at all. I was always assuming that all the q3c functions are in the public schema. Quick googling gave me thishttps://postgis.net/2017/11/07/tip-move-postgis-schema/So it may be worth a try. I won't have much free time in next week or so, but I will investigate after that. Presumably making q3c schema aware would require prefixing all the function calls with schema name in the installation script. SergeyOn 17 Feb 2020 12:12, Rasmus Handberg notifications@github.com wrote:I am trying to move the Q3C extension to a different schema than where it was originally installed, using the following ALTER EXTENSION call: ALTER EXTENSION q3c SET SCHEMA utils;

But that results in the following error message: ERROR: extension "q3c" does not support SET SCHEMA

Turns out that Q3C is installed with relocatable=False, meaning that I can't move it. I could, in principle drop the extension and install it again, but what would require me to drop all the dependencies as well, which I REALLY don't want to do! (billions of rows and a long down-time!) Is there a reason for Q3C not to be relocatable? If not, should something be changed in the "installer"? Is there a way to move it to a different schema, without dropping the extension?

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe.

segasai commented 4 years ago

I have committed a change where I set relocatable to 1 inside the q3c control file. And it seems to work fine after that. I'm about to release a new version with that change. In the meantime you should be able to just change the control file yourself by adding relocatable=1