[SCM] PostGIS branch master updated. 3.6.0rc2-609-gea6867474
git at osgeo.org
git at osgeo.org
Thu Jun 18 09:29:33 PDT 2026
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 ea686747486090d3da1a40e5b753671699b4177d (commit)
via defcb5edcd9d02ad5743e9c03a175a1b37b7b03c (commit)
from 663d846350266125cbed07fa50e3b534cfc4fe81 (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 ea686747486090d3da1a40e5b753671699b4177d
Author: Darafei Praliaskouski <me at komzpa.net>
Date: Thu Jun 18 20:27:54 2026 +0400
upgrade: clarify incomplete deprecated cleanup errors
Report a PostGIS-specific diagnostic when a repeated upgrade cannot rename a replaced function because a deprecated alias from an earlier partial cleanup still exists.
Add a focused create_upgrade generator check for that replaced-function error path.
Closes https://github.com/postgis/postgis/pull/970
Closes #5487
diff --git a/NEWS b/NEWS
index 2184d6798..0b6caaaeb 100644
--- a/NEWS
+++ b/NEWS
@@ -58,6 +58,8 @@ To take advantage of all postgis_sfcgal extension features SFCGAL 2.3+ is needed
* Bug Fixes *
+ - #5487, Improve error detail for repeated upgrades after an incomplete
+ deprecated-function cleanup (Darafei Praliaskouski)
- GH-899, [raster] Honor PostgreSQL interrupts in long-running GDAL
progress callbacks (Darafei Praliaskouski)
- #5975, Initialize skipped union-find cluster ids deterministically
diff --git a/utils/Makefile.in b/utils/Makefile.in
index 090bbedfd..42f1dd4b1 100644
--- a/utils/Makefile.in
+++ b/utils/Makefile.in
@@ -123,7 +123,10 @@ check-regress:
check: check-unit
-check-unit: postgis_restore-check
+create_upgrade_replaced_function_errors_check:
+ srcdir=$(srcdir) PERL=$(PERL) $(SHELL) $(srcdir)/check_create_upgrade_replaced_function_errors.sh
+
+check-unit: postgis_restore-check create_upgrade_replaced_function_errors_check
installdir:
@mkdir -p $(DESTDIR)$(bindir)
diff --git a/utils/check_create_upgrade_replaced_function_errors.sh b/utils/check_create_upgrade_replaced_function_errors.sh
new file mode 100644
index 000000000..caa5d375d
--- /dev/null
+++ b/utils/check_create_upgrade_replaced_function_errors.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+set -e
+
+TMPDIR="${TMPDIR:-/tmp}/check_create_upgrade_replaced_function_errors.$$"
+trap 'rm -rf "${TMPDIR}"' EXIT
+
+mkdir -p "${TMPDIR}"
+
+cat > "${TMPDIR}/postgis.sql" <<'SQL'
+-- INSTALL VERSION: 3.7.0dev
+-- Availability: 1.0.0
+-- Changed: 3.1.0 add a default argument
+-- Replaces ST_Test(geometry) deprecated in 3.1.0
+CREATE OR REPLACE FUNCTION ST_Test(geometry, float8 DEFAULT 0.0) RETURNS geometry
+AS 'MODULE_PATHNAME', 'ST_Test'
+LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE;
+SQL
+
+"${PERL:-perl}" "${srcdir:-.}/create_upgrade.pl" "${TMPDIR}/postgis.sql" > "${TMPDIR}/upgrade.sql"
+
+# The duplicate-function branch turns a PostgreSQL rename collision from a
+# partially completed upgrade into an actionable PostGIS diagnostic.
+grep -Fq \
+ "PostGIS upgrade cannot rename replaced function st_test(geometry): leftover deprecated function st_test_deprecated_by_postgis_301(geometry) already exists" \
+ "${TMPDIR}/upgrade.sql"
+
+grep -Fq \
+ "retry SELECT postgis_extensions_upgrade()" \
+ "${TMPDIR}/upgrade.sql"
diff --git a/utils/create_upgrade.pl b/utils/create_upgrade.pl
index 38826cfe6..b10ecc61e 100644
--- a/utils/create_upgrade.pl
+++ b/utils/create_upgrade.pl
@@ -505,6 +505,12 @@ EOF
EXCEPTION
WHEN undefined_function THEN
RAISE DEBUG 'Replaced function $name($args) does not exist';
+ WHEN duplicate_function THEN
+ -- The target name is left behind when an earlier upgrade could not drop
+ -- a deprecated function still referenced by user objects.
+ RAISE EXCEPTION 'PostGIS upgrade cannot rename replaced function $name($args): leftover deprecated function ${replacement} already exists'
+ USING DETAIL = 'A previous upgrade likely left ${replacement} because a user object still depends on it.',
+ HINT = 'Run SELECT postgis_full_version(); and inspect objects depending on functions named *_deprecated_by_postgis_*. Drop or update those objects, then retry SELECT postgis_extensions_upgrade().';
WHEN OTHERS THEN
GET STACKED DIAGNOSTICS detail := PG_EXCEPTION_DETAIL;
RAISE EXCEPTION 'Attempting to rename replaced function $name($args) got % (%)', SQLERRM, SQLSTATE
@@ -1062,4 +1068,3 @@ END
$$
LANGUAGE 'plpgsql';
-
commit defcb5edcd9d02ad5743e9c03a175a1b37b7b03c
Author: Darafei Praliaskouski <me at komzpa.net>
Date: Thu Jun 18 20:24:43 2026 +0400
raster: honor registered interrupts in GDAL progress
Register a postgis_raster liblwgeom interrupt callback so raster-only backends can propagate PostgreSQL cancel and death requests into long-running GDAL progress callbacks.
Restore any previously registered callback on module unload.
Closes https://github.com/postgis/postgis/pull/899
diff --git a/NEWS b/NEWS
index ce02af436..2184d6798 100644
--- a/NEWS
+++ b/NEWS
@@ -58,6 +58,8 @@ To take advantage of all postgis_sfcgal extension features SFCGAL 2.3+ is needed
* Bug Fixes *
+ - GH-899, [raster] Honor PostgreSQL interrupts in long-running GDAL
+ progress callbacks (Darafei Praliaskouski)
- #5975, Initialize skipped union-find cluster ids deterministically
(Darafei Praliaskouski)
- GH-885, [topology] Avoid GMP overflow in ring orientation for very large
diff --git a/raster/rt_core/rt_gdal.c b/raster/rt_core/rt_gdal.c
index ff01c1d66..f41c246f4 100644
--- a/raster/rt_core/rt_gdal.c
+++ b/raster/rt_core/rt_gdal.c
@@ -68,6 +68,9 @@ rt_util_gdal_progress_func(double dfComplete, const char *pszMessage, void *pPro
(void)dfComplete;
(void)pszMessage;
+ if (_lwgeom_interrupt_callback)
+ (*_lwgeom_interrupt_callback)();
+
if (_lwgeom_interrupt_requested)
{
// rtwarn("%s interrupted at %g", (const char*)pProgressArg, dfComplete);
@@ -307,4 +310,3 @@ int rt_raster_gdal_contour(
/* Done */
return TRUE;
}
-
diff --git a/raster/rt_pg/rtpostgis.c b/raster/rt_pg/rtpostgis.c
index 49089b70e..663fe8552 100644
--- a/raster/rt_pg/rtpostgis.c
+++ b/raster/rt_pg/rtpostgis.c
@@ -137,6 +137,7 @@
#include "utils/builtins.h"
#include "utils/memutils.h"
#include "utils/elog.h"
+#include "miscadmin.h"
/* PostGIS */
#include "postgis_config.h"
@@ -149,6 +150,18 @@
#include "rtpostgis.h"
#include "rtpg_internal.h"
+static void
+rtpg_interrupt_liblwgeom_callback(void)
+{
+#ifdef WIN32
+ if (UNBLOCKED_SIGNAL_QUEUE())
+ pgwin32_dispatch_queued_signals();
+#endif
+ if (QueryCancelPending || ProcDiePending)
+ lwgeom_request_interrupt();
+}
+
+static lwinterrupt_callback *prev_liblwgeom_interrupt_callback = NULL;
#ifndef __GNUC__
# define __attribute__ (x)
@@ -715,6 +728,7 @@ _PG_init(void) {
/* Install liblwgeom handlers */
pg_install_lwgeom_handlers();
+ prev_liblwgeom_interrupt_callback = lwgeom_register_interrupt_callback(rtpg_interrupt_liblwgeom_callback);
/* Install rtcore handlers */
rt_set_handlers_options(rt_pg_alloc, rt_pg_realloc, rt_pg_free,
@@ -847,6 +861,9 @@ _PG_fini(void) {
elog(NOTICE, "Goodbye from PostGIS Raster %s", POSTGIS_VERSION);
+ lwgeom_register_interrupt_callback(prev_liblwgeom_interrupt_callback);
+ prev_liblwgeom_interrupt_callback = NULL;
+
/* Clean up */
pfree(env_postgis_gdal_enabled_drivers);
pfree(boot_postgis_gdal_enabled_drivers);
@@ -859,6 +876,3 @@ _PG_fini(void) {
/* Revert back to old context */
MemoryContextSwitchTo(old_context);
}
-
-
-
-----------------------------------------------------------------------
Summary of changes:
NEWS | 4 +++
raster/rt_core/rt_gdal.c | 4 ++-
raster/rt_pg/rtpostgis.c | 20 ++++++++++++---
utils/Makefile.in | 5 +++-
...heck_create_upgrade_replaced_function_errors.sh | 30 ++++++++++++++++++++++
utils/create_upgrade.pl | 7 ++++-
6 files changed, 64 insertions(+), 6 deletions(-)
create mode 100644 utils/check_create_upgrade_replaced_function_errors.sh
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list