[postgis-tickets] r17319 - Drop support for stdout in extensions_unpackage.sh

Sandro Santilli strk at kbt.io
Sun Mar 10 11:51:13 PDT 2019


Author: strk
Date: 2019-03-10 11:51:13 -0700 (Sun, 10 Mar 2019)
New Revision: 17319

Modified:
   trunk/extensions/extensions_unpackage.sh
Log:
Drop support for stdout in extensions_unpackage.sh

There wasn't much point in it, as we need a database name to
produce the script anyway.

Modified: trunk/extensions/extensions_unpackage.sh
===================================================================
--- trunk/extensions/extensions_unpackage.sh	2019-03-10 18:51:04 UTC (rev 17318)
+++ trunk/extensions/extensions_unpackage.sh	2019-03-10 18:51:13 UTC (rev 17319)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test -n "$1" || {
-  echo "Usage: $0 { <dbname> | - }"
+  echo "Usage: $0 <dbname>"
   exit 1
 }
 
@@ -28,13 +28,8 @@
 WHERE d.refclassid = 'pg_catalog.pg_extension'::pg_catalog.regclass
 AND deptype = 'e' AND e.extname = '${ext}' ORDER BY sqladd;
 
-SELECT 'DROP EXTENSION ${ext};';
+SELECT 'DROP EXTENSION IF EXISTS ${ext};';
 
 EOF
   done
-) |
-if test ${db} = '-'; then
-  cat
-else
-  psql -XtA ${db}
-fi
+) | psql -XtA ${db}



More information about the postgis-tickets mailing list