[postgis-devel] getting out of extension ?
Paragon Corporation
lr at pcorp.us
Sat Sep 29 08:34:20 PDT 2012
Strk,
Okay I'm going to give away a trade secret?
This will generate the statement to drop all objects from the postgis
extension (change word postgis to postgis_topology to do the same for
topology)
----
SELECT 'ALTER EXTENSION ' || extname || ' DROP ' || regexp_replace(
regexp_replace(pg_catalog.pg_describe_object(d.classid, d.objid, 0),
E'cast from (.*) to (.*)', E'cast\(\\1 as \\2\)'),
E'(.*) for access method (.*)', E'\\1 using \\2') || ';' AS sqladd
FROM pg_catalog.pg_depend AS d
INNER JOIN pg_extension AS e ON (d.refobjid = e.oid)
WHERE d.refclassid = 'pg_catalog.pg_extension'::pg_catalog.regclass
AND deptype = 'e' AND e.extname = 'postgis'
ORDER BY sqladd;
Once you run that, you can safely do
DROP EXTENSION postgis;
And then upgrade as usual.
Note: If you have postgis_topology installed, you'll have to first do the
same for postgis_topology before you can drop postgis.
This script is in extensions/make_unpackaged.sql
It's exactly like repackaging as you can see except for packaging an
unpackaged postgis you have the word "ADD" instead of "DROP".
Regina
-----Original Message-----
From: postgis-devel-bounces at postgis.refractions.net
[mailto:postgis-devel-bounces at postgis.refractions.net] On Behalf Of Sandro
Santilli
Sent: Saturday, September 29, 2012 4:48 AM
To: postgis-devel at postgis.refractions.net
Subject: [postgis-devel] getting out of extension ?
How do I get all my postgis functions out of the EXTENSION jail ?
I would love to get back to be able to use the _upgrade_minor*.sql scripts
during development but don't want to dump-reload my test db on which I used
CREATE EXTENSION for testing...
PS: forgive me if this is a FAQ, but couldn't find it in the
current manual
--strk;
_______________________________________________
postgis-devel mailing list
postgis-devel at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-devel
More information about the postgis-devel
mailing list