[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-910-g9ffcf3546

git at osgeo.org git at osgeo.org
Thu May 18 16:05:01 PDT 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  9ffcf35468db241308ae961fbac851a5443f4fec (commit)
      from  c3a1796345775c49691d5563056ab0f7aad50005 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9ffcf35468db241308ae961fbac851a5443f4fec
Author: Sandro Santilli <strk at kbt.io>
Date:   Fri May 19 01:04:41 2023 +0200

    Provide an sql version of extensions unpackage

diff --git a/extensions/extensions_unpackage.sh b/extensions/extensions_unpackage.sh
index 44a6384ca..b88bb7d21 100755
--- a/extensions/extensions_unpackage.sh
+++ b/extensions/extensions_unpackage.sh
@@ -6,30 +6,4 @@ test -n "$1" || {
 }
 
 db="$1"
-
-EXTENSIONS="postgis_sfcgal postgis_raster postgis_topology postgis"
-
-(
-  for ext in $EXTENSIONS; do
-    cat <<EOF
-
-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 = '${ext}' ORDER BY sqladd;
-
-SELECT 'DROP EXTENSION IF EXISTS ${ext};';
-
-EOF
-  done
-) | psql -XtA ${db}
+psql -XtA -f $(dirname $0)/extensions_unpackage.sql ${db}
diff --git a/extensions/extensions_unpackage.sql b/extensions/extensions_unpackage.sql
new file mode 100644
index 000000000..2638f3d97
--- /dev/null
+++ b/extensions/extensions_unpackage.sql
@@ -0,0 +1,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;

-----------------------------------------------------------------------

Summary of changes:
 extensions/extensions_unpackage.sh  | 28 +---------------------------
 extensions/extensions_unpackage.sql | 31 +++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 27 deletions(-)
 create mode 100644 extensions/extensions_unpackage.sql


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list