[SCM] PostGIS branch stable-3.3 updated. 3.3.4-24-gc8eb40d30

git at osgeo.org git at osgeo.org
Thu Oct 26 23:46:06 PDT 2023


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.3 has been updated
       via  c8eb40d30f4afb93d9c06fa18176c6ea98e352f6 (commit)
      from  ffeff70d79aa2d33cf8487d5adc59b0a8238cabd (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 c8eb40d30f4afb93d9c06fa18176c6ea98e352f6
Author: Sandro Santilli <strk at kbt.io>
Date:   Thu Oct 26 18:56:54 2023 +0200

    Use function-specific search_path to improve readability

diff --git a/libpgcommon/sql/AddToSearchPath.sql.inc b/libpgcommon/sql/AddToSearchPath.sql.inc
index 2499bfa91..c3746c522 100644
--- a/libpgcommon/sql/AddToSearchPath.sql.inc
+++ b/libpgcommon/sql/AddToSearchPath.sql.inc
@@ -15,15 +15,15 @@ DECLARE
 	a_schema_name text := $1;
 BEGIN
 	WITH settings AS (
-		SELECT pg_catalog.unnest(setconfig) config
-		FROM pg_catalog.pg_db_role_setting
-		WHERE setdatabase OPERATOR(pg_catalog.=) (
+		SELECT unnest(setconfig) config
+		FROM pg_db_role_setting
+		WHERE setdatabase = (
 			SELECT oid
-			FROM pg_catalog.pg_database
-			WHERE datname OPERATOR(pg_catalog.=) pg_catalog.current_database()
-		) and setrole OPERATOR(pg_catalog.=) 0
+			FROM pg_database
+			WHERE datname = current_database()
+		) and setrole = 0
 	)
-	SELECT pg_catalog.regexp_replace(config, '^search_path=', '')
+	SELECT regexp_replace(config, '^search_path=', '')
 	FROM settings WHERE config like 'search_path=%'
 	INTO var_cur_search_path;
 
@@ -32,8 +32,8 @@ BEGIN
 	IF var_cur_search_path IS NULL THEN
 		SELECT setting
 		INTO var_cur_search_path
-		FROM pg_catalog.pg_file_settings
-		WHERE name OPERATOR(pg_catalog.=) 'search_path' AND applied;
+		FROM pg_file_settings
+		WHERE name = 'search_path' AND applied;
 
 		RAISE NOTICE 'cur_search_path from pg_file_settings is %', var_cur_search_path;
 	END IF;
@@ -41,26 +41,28 @@ BEGIN
 	IF var_cur_search_path IS NULL THEN
 		SELECT boot_val
 		INTO var_cur_search_path
-		FROM pg_catalog.pg_settings
-		WHERE name OPERATOR(pg_catalog.=) 'search_path';
+		FROM 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 '%' OPERATOR(pg_catalog.||) pg_catalog.quote_ident(a_schema_name) OPERATOR(pg_catalog.||) '%' THEN
-		var_result := a_schema_name OPERATOR(pg_catalog.||) ' already in database search_path';
+	IF var_cur_search_path LIKE '%' || quote_ident(a_schema_name) || '%' THEN
+		var_result := a_schema_name || ' already in database search_path';
 	ELSE
-		var_cur_search_path := var_cur_search_path OPERATOR(pg_catalog.||) ', '
-                       OPERATOR(pg_catalog.||) pg_catalog.quote_ident(a_schema_name);
-		EXECUTE 'ALTER DATABASE ' OPERATOR(pg_catalog.||) pg_catalog.quote_ident(pg_catalog.current_database())
-                             OPERATOR(pg_catalog.||) ' SET search_path = ' OPERATOR(pg_catalog.||) var_cur_search_path;
-		var_result := a_schema_name OPERATOR(pg_catalog.||) ' has been added to end of database search_path ';
+		var_cur_search_path := var_cur_search_path || ', '
+                       || quote_ident(a_schema_name);
+		EXECUTE 'ALTER DATABASE ' || quote_ident(current_database())
+                             || ' SET search_path = ' || var_cur_search_path;
+		var_result := a_schema_name || ' has been added to end of database search_path ';
 	END IF;
 
-	EXECUTE 'SET search_path = ' OPERATOR(pg_catalog.||) var_cur_search_path;
+	EXECUTE 'SET search_path = ' || var_cur_search_path;
 
   RETURN var_result;
 END
 $BODY$
-LANGUAGE 'plpgsql' VOLATILE STRICT;
+SET search_path = pg_catalog -- make safe
+LANGUAGE 'plpgsql' VOLATILE STRICT
+;
 

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

Summary of changes:
 libpgcommon/sql/AddToSearchPath.sql.inc | 42 +++++++++++++++++----------------
 1 file changed, 22 insertions(+), 20 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list