[postgis-tickets] [SCM] PostGIS branch stable-3.1 updated. 3.1.5-12-gb175c26ee

git at osgeo.org git at osgeo.org
Thu May 19 19:58:24 PDT 2022


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, stable-3.1 has been updated
       via  b175c26eee538e472aaf1a22afd2099b14d60481 (commit)
       via  e10cabb1fabf1cf9d452d1c5758ee448e105241b (commit)
      from  c14e9a059aca3ee39fdbfab88190da5172a81122 (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 b175c26eee538e472aaf1a22afd2099b14d60481
Author: Regina Obe <lr at pcorp.us>
Date:   Thu May 19 22:56:53 2022 -0400

    Numerous fixes to helper functions.
    References #5150
    References #5125
    References #5155  for PostGIS 3.1.6

diff --git a/NEWS b/NEWS
index 1f54a4460..2370acda9 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,9 @@ PostGIS 3.1.6dev
   - #5100, Stop using pg_atoi, removed in PG 15 (Laurenz Albe)
   - #5115, Allow dropping topologies with pending constraints (Sandro Santilli)
   - #5151, ST_SetPoint with empty geometries (Regina Obe)
+	- #5150, Change signature of AddToSearchPath (Regina Obe)
+ 	- #5125, Fix search path function (Sandro Santilli)
+ 	- #5155, More schema qual fixes (Regina Obe)
 
 PostGIS 3.1.5
 2022/02/01
diff --git a/extensions/postgis_extension_helper.sql b/extensions/postgis_extension_helper.sql
index aa0713407..e40f03a9f 100644
--- a/extensions/postgis_extension_helper.sql
+++ b/extensions/postgis_extension_helper.sql
@@ -18,7 +18,7 @@
 -- this is needed because there is no ALTER EXTENSION DROP FUNCTION/AGGREGATE command
 -- and we can't CREATE OR REPALCe functions whose signatures have changed and we can drop them if they are part of an extention
 -- So we use this to remove it from extension first before we drop
-CREATE OR REPLACE FUNCTION postgis_extension_remove_objects(param_extension text, param_type text)
+CREATE FUNCTION postgis_extension_remove_objects(param_extension text, param_type text)
   RETURNS boolean AS
 $$
 DECLARE
@@ -81,7 +81,7 @@ END;
 $$
 LANGUAGE plpgsql VOLATILE;
 
-CREATE OR REPLACE FUNCTION postgis_extension_drop_if_exists(param_extension text, param_statement text)
+CREATE FUNCTION postgis_extension_drop_if_exists(param_extension text, param_statement text)
   RETURNS boolean AS
 $$
 DECLARE
@@ -101,7 +101,7 @@ END;
 $$
 LANGUAGE plpgsql VOLATILE;
 
-CREATE OR REPLACE FUNCTION postgis_extension_AddToSearchPath(a_schema_name varchar)
+CREATE FUNCTION postgis_extension_AddToSearchPath(a_schema_name text)
 RETURNS text
 AS
 $$
@@ -109,7 +109,30 @@ DECLARE
 	var_result text;
 	var_cur_search_path text;
 BEGIN
-	SELECT reset_val INTO var_cur_search_path FROM pg_catalog.pg_settings WHERE name = 'search_path';
+
+	WITH settings AS (
+		SELECT pg_catalog.unnest(setconfig) config
+		FROM pg_catalog.pg_db_role_setting
+		WHERE setdatabase = (
+			SELECT oid
+			FROM pg_catalog.pg_database
+			WHERE datname = current_database()
+		) and setrole = 0
+	)
+	SELECT pg_catalog.regexp_replace(config, '^search_path=', '')
+	FROM settings WHERE config like 'search_path=%'
+	INTO var_cur_search_path;
+
+	RAISE NOTICE 'cur_search_path from pg_db_role_setting is %', var_cur_search_path;
+
+	IF var_cur_search_path IS NULL THEN
+		SELECT reset_val
+		INTO var_cur_search_path
+		FROM pg_catalog.pg_settings
+		WHERE name = 'search_path';
+
+		RAISE NOTICE 'cur_search_path from pg_settings is %', var_cur_search_path;
+	END IF;
 	IF var_cur_search_path LIKE '%' || pg_catalog.quote_ident(a_schema_name) || '%' THEN
 		var_result := a_schema_name || ' already in database search_path';
 	ELSE
diff --git a/extensions/postgis_extension_helper_uninstall.sql b/extensions/postgis_extension_helper_uninstall.sql
index b08048fd9..2fb1d1756 100644
--- a/extensions/postgis_extension_helper_uninstall.sql
+++ b/extensions/postgis_extension_helper_uninstall.sql
@@ -15,4 +15,5 @@
 -- and should be called at the end of the extension upgrade file
 DROP FUNCTION postgis_extension_remove_objects(text, text);
 DROP FUNCTION postgis_extension_drop_if_exists(text, text);
-DROP FUNCTION postgis_extension_AddToSearchPath(varchar);
+DROP FUNCTION IF EXISTS postgis_extension_AddToSearchPath(varchar);
+DROP FUNCTION IF EXISTS postgis_extension_AddToSearchPath(text);

commit e10cabb1fabf1cf9d452d1c5758ee448e105241b
Author: Regina Obe <lr at pcorp.us>
Date:   Thu May 19 22:53:05 2022 -0400

    Only test window functions with OVER (not aggs).  We did not backport some agg over crashers to 3.1

diff --git a/doc/xsl/postgis_gardentest.sql.xsl b/doc/xsl/postgis_gardentest.sql.xsl
index 8aec3efc1..871163589 100644
--- a/doc/xsl/postgis_gardentest.sql.xsl
+++ b/doc/xsl/postgis_gardentest.sql.xsl
@@ -526,11 +526,11 @@ SELECT '<xsl:value-of select="$log_label" /> Geography: End Testing';
 				  </xsl:choose>
 				</xsl:variable>
 
-				<!-- is a window or aggregate function -->
+				<!-- is a window function -->
 				<xsl:variable name='over_clause'>
 					 <xsl:choose>
-					 	<xsl:when test="paramdef/type[contains(text(),'set')]">
-					 		<xsl:value-of select="'OVER(ORDER BY random())'"/>
+					 	<xsl:when test="paramdef/type[contains(text(),'winset')]">
+					 		<xsl:value-of select="'OVER(random())'"/>
 					 	</xsl:when>
 					<xsl:otherwise>
 					  <xsl:value-of select="''"/>

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

Summary of changes:
 NEWS                                              |  3 +++
 doc/xsl/postgis_gardentest.sql.xsl                |  6 ++---
 extensions/postgis_extension_helper.sql           | 31 ++++++++++++++++++++---
 extensions/postgis_extension_helper_uninstall.sql |  3 ++-
 4 files changed, 35 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list