[SCM] PostGIS branch master updated. 3.4.0rc1-1123-gca40cf9a7
git at osgeo.org
git at osgeo.org
Fri May 24 08:44:08 PDT 2024
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 ca40cf9a70e6225f5e07a167f10ce3341b90ff7d (commit)
via 10b65858c21679cb3cf6d26a928d84e560172ed3 (commit)
from d29ba84cb05988ab0aa1b2da3eef90108dfae1db (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 ca40cf9a70e6225f5e07a167f10ce3341b90ff7d
Author: Sandro Santilli <strk at kbt.io>
Date: Fri May 24 17:40:31 2024 +0200
Do not print errors if upgraded database does not have postgis
diff --git a/loader/postgis.pl b/loader/postgis.pl
index a09713b33..553e22162 100644
--- a/loader/postgis.pl
+++ b/loader/postgis.pl
@@ -189,20 +189,29 @@ sub upgrade
foreach my $db (@_)
{
- print "upgrading db $db\n";
- my $LOG=`cat <<EOF | psql -qXtA ${db}
-BEGIN;
-UPDATE pg_catalog.pg_extension SET extversion = 'ANY'
- WHERE extname IN (
- 'postgis',
- 'postgis_raster',
- 'postgis_sfcgal',
- 'postgis_topology',
- 'postgis_tiger_geocoder'
- );
-SELECT postgis_extensions_upgrade();
-COMMIT;
-EOF`;
+ print "upgrading db $db if needed\n";
+ open(my $SESSION, "| psql -qXtA ${db} |") || die "Could not connect to database ${db}";
+ print $SESSION <<'EOF';
+DO $BODY$
+BEGIN
+ IF EXISTS ( SELECT * FROM pg_proc where proname = 'postgis_extensions_upgrade' )
+ THEN
+ UPDATE pg_catalog.pg_extension SET extversion = 'ANY'
+ WHERE extname IN (
+ 'postgis',
+ 'postgis_raster',
+ 'postgis_sfcgal',
+ 'postgis_topology',
+ 'postgis_tiger_geocoder'
+ );
+ PERFORM postgis_extensions_upgrade();
+ END IF;
+END;
+$BODY$ LANGUAGE 'plpgsql';
+EOF
+ @out = <$SESSION>;
+ print @out;
+ close($SESSION);
}
}
commit 10b65858c21679cb3cf6d26a928d84e560172ed3
Author: Sandro Santilli <strk at kbt.io>
Date: Fri May 24 17:39:51 2024 +0200
Use 2 spaces indent in loader/postgis.pl
diff --git a/.editorconfig b/.editorconfig
index 3c1c705e3..a5d7b210b 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -40,6 +40,11 @@ indent_size = 2
indent_style = space
indent_size = 4
+# Exception: loader/postgis.pl uses 2-spaces indent
+[loader/postgis.pl]
+indent_style = space
+indent_size = 2
+
# SQL files want tab indentation
[*.{sql,sql.in}]
indent_style = tab
-----------------------------------------------------------------------
Summary of changes:
.editorconfig | 5 +++++
loader/postgis.pl | 37 +++++++++++++++++++++++--------------
2 files changed, 28 insertions(+), 14 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list