modify custom variables

Started by Vincent Moraalmost 12 years ago2 messageshackers
Jump to latest
#1Vincent Mora
vincent.mora@oslandia.com

Hi,

When creating postgis extension, a call to DefineCustomStringVariable is
made to define postgis.backend.

An assign hook allows to change the library used by spatial functions
whith a:

SET postgis.backend = 'sfcgal'; -- or 'geos'

Everything work fine execept when upgrading postgis.

If I understand the problem correctly, on upgrate (ALTER EXTENSION), the
old postgis library is already loaded, the old spatial functions are
replaced by new ones pointing to the new postgis library, a call to
DefineCustomStringVariable is made and:

ERROR: attempt to redefine parameter "postgis.backend"

I need to redefine the assign hook such that is calls the new library
backend and not the old one.

Is there a way to remove/modify custom variables ? I looked in guc.h but
couldn't find anything.

Thanks,

V.

PS: I'm working on http://trac.osgeo.org/postgis/ticket/2382.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Vincent Mora (#1)
Re: modify custom variables

Vincent Mora <vincent.mora@oslandia.com> writes:

If I understand the problem correctly, on upgrate (ALTER EXTENSION), the
old postgis library is already loaded, the old spatial functions are
replaced by new ones pointing to the new postgis library, a call to
DefineCustomStringVariable is made and:

ERROR: attempt to redefine parameter "postgis.backend"

I need to redefine the assign hook such that is calls the new library
backend and not the old one.

I think what you need to do is arrange the upgrade process so that the old
shared library doesn't get loaded in the same session as the new one.
Otherwise, you're likely to have lots more problems than just this.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers