[SCM] PostGIS branch master updated. 3.5.0-223-g1237c6b4d
git at osgeo.org
git at osgeo.org
Wed Mar 12 03:50:36 PDT 2025
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 1237c6b4d682963d9954b4a74cde3cd0163afb6a (commit)
from d345ba7e1da4263a0f29b5424c4d10a73b1597c6 (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 1237c6b4d682963d9954b4a74cde3cd0163afb6a
Author: Sandro Santilli <strk at kbt.io>
Date: Wed Mar 12 11:48:34 2025 +0100
Add --drop-topology switch to pgtopo_import
Closes #5861
diff --git a/NEWS b/NEWS
index 4c979824c..89f7b8d6a 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,7 @@ PostGIS 3.6.0
* New Features *
+ - #5861, Add --drop-topology switch to pgtopo_import (Sandro Santilli)
- #1247, ST_AsRasterAgg (Sandro Santilli)
- #5784, GT-223 Export circ_tree_distance_tree_internal for mobilitydb use
(Maxime Schoemans)
diff --git a/topology/loader/pgtopo_import b/topology/loader/pgtopo_import
index beceaeed6..1d7685021 100755
--- a/topology/loader/pgtopo_import
+++ b/topology/loader/pgtopo_import
@@ -13,13 +13,19 @@
set -e
usage() {
- echo "Usage: $(basename $0) [ --skip-layers | --only-layers ] [ -f <dumpfile> ] <toponame>"
+ echo "Usage: $(basename $0) [OPTIONS] <toponame>"
+ echo "OPTIONS:"
+ echo " --skip-layers Skip importing layers"
+ echo " --only-layers Only import layers"
+ echo " --drop-topology Drop topology before importing it"
+ echo " -f <dumpfile> Read dump from <file> instead of stdin"
}
SKIP_LAYERS=no
ONLY_LAYERS=no
+DROP_TOPOLOGY=no
TOPONAME=
DUMPFILE=-
@@ -30,6 +36,9 @@ while test -n "$1"; do
elif test "$1" = '--only-layers'; then
ONLY_LAYERS=yes
shift
+ elif test "$1" = '--drop-topology'; then
+ DROP_TOPOLOGY=yes
+ shift
elif test "$1" = '-f'; then
shift
DUMPFILE="$1"
@@ -92,6 +101,17 @@ test ${DUMPVERSION} -eq '1' || {
echo "BEGIN;"
if test "$ONLY_LAYERS" = "no"; then # {
+ #################################################
+ # Drop any existing topology if requested so
+ #################################################
+ if test "$DROP_TOPOLOGY" = "yes"; then #{
+ cat<<EOF
+ SELECT topology.DropTopology(
+ '${TOPONAME}'
+ );
+EOF
+ fi #}
+
#################################################
# Create topology
#################################################
-----------------------------------------------------------------------
Summary of changes:
NEWS | 1 +
topology/loader/pgtopo_import | 22 +++++++++++++++++++++-
2 files changed, 22 insertions(+), 1 deletion(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list