File: extensions_unpackage.sql

package info (click to toggle)
postgis 3.6.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 74,680 kB
  • sloc: ansic: 163,427; sql: 95,196; xml: 54,290; cpp: 12,646; perl: 5,875; sh: 5,415; makefile: 3,492; python: 1,207; yacc: 447; lex: 151; pascal: 58
file content (31 lines) | stat: -rw-r--r-- 835 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
\set QUIET
BEGIN;
set client_min_messages to WARNING;
SELECT 'ALTER EXTENSION ' || extname || ' DROP ' ||
  regexp_replace(
    regexp_replace(
      pg_catalog.pg_describe_object(d.classid, d.objid, 0),
      'cast from (.*) to (.*)',
      'cast(\1 as \2)'
    ),
    '(.*) for access method (.*)',
    '\1 using \2'
  ) || ';'
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 in (
	'postgis_sfcgal',
	'postgis_raster',
	'postgis_topology',
	'postgis'
)
ORDER BY length(e.extname) DESC
\gexec

DROP EXTENSION IF EXISTS postgis_sfcgal;
DROP EXTENSION IF EXISTS postgis_raster;
DROP EXTENSION IF EXISTS postgis_topology;
DROP EXTENSION IF EXISTS postgis;
SELECT 'PostGIS objects unpackaged';
COMMIT;