[postgis-tickets] [SCM] PostGIS branch stable-3.0 updated. 3.0.4-6-g7e88a075f
git at osgeo.org
git at osgeo.org
Tue Feb 1 23:06:58 PST 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.0 has been updated
via 7e88a075f3ec17b1cb6b0ce9e6561d469ce4a268 (commit)
from 6287b09999f5f033ea8d3257b402fa69e47a3730 (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 7e88a075f3ec17b1cb6b0ce9e6561d469ce4a268
Author: Regina Obe <lr at pcorp.us>
Date: Wed Feb 2 02:06:50 2022 -0500
Search path vulnerability during install/upgrade. References #5069 for PostGIS 3.0.5
diff --git a/NEWS b/NEWS
index 0cd4cd777..5bd0189b5 100644
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,11 @@
PostGIS 3.0.5
-2021/XX/XX
+2022/02/XX
* Bug Fixes and Enhancements *
- #5026, fix DropTopology in presence of UPDATE triggers on
topology layers (Sandro Santilli)
- #5046, Fix upgrades in absence of old library (Sandro Santilli)
+ - #5069, search_path vulnerabilty during install/upgrade
+ (Regina Obe)
PostGIS 3.0.4
2021/09/04
diff --git a/extensions/postgis/unpackage_raster_if_needed.sql b/extensions/postgis/unpackage_raster_if_needed.sql
index 8b111bc6c..c344ea561 100644
--- a/extensions/postgis/unpackage_raster_if_needed.sql
+++ b/extensions/postgis/unpackage_raster_if_needed.sql
@@ -1,10 +1,10 @@
DO $unpackage_if_needed$
BEGIN
IF EXISTS (
- select t.typname from pg_depend d, pg_extension e, pg_type t where
+ select t.typname from pg_catalog.pg_depend d, pg_catalog.pg_extension e, pg_catalog.pg_type t where
e.extname = 'postgis' and d.refclassid =
'pg_catalog.pg_extension'::pg_catalog.regclass and d.refobjid = e.oid
- and d.classid = 'pg_type'::regclass and d.objid = t.oid
+ and d.classid = 'pg_catalog.pg_type'::pg_catalog.regclass and d.objid = t.oid
and t.typname = 'raster'
) THEN
diff --git a/extensions/postgis_extension_helper.sql b/extensions/postgis_extension_helper.sql
index bc1e9f92d..60af72748 100644
--- a/extensions/postgis_extension_helper.sql
+++ b/extensions/postgis_extension_helper.sql
@@ -30,38 +30,38 @@ DECLARE
var_sql_list text := '';
var_pgsql_version integer := current_setting('server_version_num');
BEGIN
- var_class := CASE WHEN lower(param_type) = 'function' OR lower(param_type) = 'aggregate' THEN 'pg_proc' ELSE '' END;
- var_is_aggregate := CASE WHEN lower(param_type) = 'aggregate' THEN true ELSE false END;
+ var_class := CASE WHEN pg_catalog.lower(param_type) = 'function' OR pg_catalog.lower(param_type) = 'aggregate' THEN 'pg_proc' ELSE '' END;
+ var_is_aggregate := CASE WHEN pg_catalog.lower(param_type) = 'aggregate' THEN true ELSE false END;
IF var_pgsql_version < 110000 THEN
var_sql_list := $sql$SELECT 'ALTER EXTENSION ' || e.extname || ' DROP ' || $3 || ' ' || COALESCE(proc.proname || '(' || oidvectortypes(proc.proargtypes) || ')' ,typ.typname, cd.relname, op.oprname,
cs.typname || ' AS ' || ct.typname || ') ', opcname, opfname) || ';' AS remove_command
- FROM pg_depend As d INNER JOIN pg_extension As e
- ON d.refobjid = e.oid INNER JOIN pg_class As c ON
+ FROM pg_catalog.pg_depend As d INNER JOIN pg_catalog.pg_extension As e
+ ON d.refobjid = e.oid INNER JOIN pg_catalog.pg_class As c ON
c.oid = d.classid
- LEFT JOIN pg_proc AS proc ON proc.oid = d.objid
- LEFT JOIN pg_type AS typ ON typ.oid = d.objid
- LEFT JOIN pg_class As cd ON cd.oid = d.objid
+ LEFT JOIN pg_catalog.pg_proc AS proc ON proc.oid = d.objid
+ LEFT JOIN pg_catalog.pg_type AS typ ON typ.oid = d.objid
+ LEFT JOIN pg_catalog.pg_class As cd ON cd.oid = d.objid
LEFT JOIN pg_operator As op ON op.oid = d.objid
- LEFT JOIN pg_cast AS ca ON ca.oid = d.objid
- LEFT JOIN pg_type AS cs ON ca.castsource = cs.oid
- LEFT JOIN pg_type AS ct ON ca.casttarget = ct.oid
+ LEFT JOIN pg_catalog.pg_cast AS ca ON ca.oid = d.objid
+ LEFT JOIN pg_catalog.pg_type AS cs ON ca.castsource = cs.oid
+ LEFT JOIN pg_catalog.pg_type AS ct ON ca.casttarget = ct.oid
LEFT JOIN pg_opclass As oc ON oc.oid = d.objid
LEFT JOIN pg_opfamily As ofa ON ofa.oid = d.objid
WHERE d.deptype = 'e' and e.extname = $1 and c.relname = $2 AND COALESCE(proc.proisagg, false) = $4;$sql$;
ELSE -- for PostgreSQL 11 and above, they removed proc.proisagg among others and replaced with some func type thing
var_sql_list := $sql$SELECT 'ALTER EXTENSION ' || e.extname || ' DROP ' || $3 || ' ' || COALESCE(proc.proname || '(' || oidvectortypes(proc.proargtypes) || ')' ,typ.typname, cd.relname, op.oprname,
cs.typname || ' AS ' || ct.typname || ') ', opcname, opfname) || ';' AS remove_command
- FROM pg_depend As d INNER JOIN pg_extension As e
- ON d.refobjid = e.oid INNER JOIN pg_class As c ON
+ FROM pg_catalog.pg_depend As d INNER JOIN pg_catalog.pg_extension As e
+ ON d.refobjid = e.oid INNER JOIN pg_catalog.pg_class As c ON
c.oid = d.classid
- LEFT JOIN pg_proc AS proc ON proc.oid = d.objid
- LEFT JOIN pg_type AS typ ON typ.oid = d.objid
- LEFT JOIN pg_class As cd ON cd.oid = d.objid
+ LEFT JOIN pg_catalog.pg_proc AS proc ON proc.oid = d.objid
+ LEFT JOIN pg_catalog.pg_type AS typ ON typ.oid = d.objid
+ LEFT JOIN pg_catalog.pg_class As cd ON cd.oid = d.objid
LEFT JOIN pg_operator As op ON op.oid = d.objid
- LEFT JOIN pg_cast AS ca ON ca.oid = d.objid
- LEFT JOIN pg_type AS cs ON ca.castsource = cs.oid
- LEFT JOIN pg_type AS ct ON ca.casttarget = ct.oid
+ LEFT JOIN pg_catalog.pg_cast AS ca ON ca.oid = d.objid
+ LEFT JOIN pg_catalog.pg_type AS cs ON ca.castsource = cs.oid
+ LEFT JOIN pg_catalog.pg_type AS ct ON ca.casttarget = ct.oid
LEFT JOIN pg_opclass As oc ON oc.oid = d.objid
LEFT JOIN pg_opfamily As ofa ON ofa.oid = d.objid
WHERE d.deptype = 'e' and e.extname = $1 and c.relname = $2 AND (proc.prokind = 'a') = $4;$sql$;
@@ -85,7 +85,7 @@ CREATE OR REPLACE FUNCTION postgis_extension_drop_if_exists(param_extension text
RETURNS boolean AS
$$
DECLARE
- var_sql_ext text := 'ALTER EXTENSION ' || quote_ident(param_extension) || ' ' || replace(param_statement, 'IF EXISTS', '');
+ var_sql_ext text := 'ALTER EXTENSION ' || pg_catalog.quote_ident(param_extension) || ' ' || pg_catalog.replace(param_statement, 'IF EXISTS', '');
var_result boolean := false;
BEGIN
BEGIN
@@ -109,13 +109,13 @@ DECLARE
var_result text;
var_cur_search_path text;
BEGIN
- SELECT reset_val INTO var_cur_search_path FROM pg_settings WHERE name = 'search_path';
- IF var_cur_search_path LIKE '%' || quote_ident(a_schema_name) || '%' THEN
+ SELECT reset_val INTO var_cur_search_path FROM pg_catalog.pg_settings WHERE name = 'search_path';
+ 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
var_cur_search_path := var_cur_search_path || ', '
- || quote_ident(a_schema_name);
- EXECUTE 'ALTER DATABASE ' || quote_ident(current_database())
+ || pg_catalog.quote_ident(a_schema_name);
+ EXECUTE 'ALTER DATABASE ' || pg_catalog.quote_ident(pg_catalog.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;
diff --git a/extras/tiger_geocoder/utility/set_search_path.sql b/extras/tiger_geocoder/utility/set_search_path.sql
index c8e8595bb..19d2f9523 100644
--- a/extras/tiger_geocoder/utility/set_search_path.sql
+++ b/extras/tiger_geocoder/utility/set_search_path.sql
@@ -13,9 +13,9 @@ DECLARE
var_result text;
var_cur_search_path text;
BEGIN
- SELECT reset_val INTO var_cur_search_path FROM pg_settings WHERE name = 'search_path';
+ SELECT reset_val INTO var_cur_search_path FROM pg_catalog.pg_settings WHERE name = 'search_path';
- EXECUTE 'SET search_path = ' || quote_ident(a_schema_name) || ', ' || var_cur_search_path;
+ EXECUTE 'SET search_path = ' || pg_catalog.quote_ident(a_schema_name) || ', ' || var_cur_search_path;
var_result := a_schema_name || ' has been made primary for install ';
RETURN var_result;
END
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index 7bf0bfcd5..26bd3da64 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -29,15 +29,15 @@ DO $$
DECLARE
pgver text;
BEGIN
- SELECT substring(version(), 'PostgreSQL ([0-9\.]+)') INTO pgver;
+ SELECT pg_catalog.substring(pg_catalog.version(), 'PostgreSQL ([0-9\.]+)') INTO pgver;
IF POSTGIS_PGSQL_VERSION::text != ( SELECT CASE
- WHEN split_part(s,'.',1)::integer > 9
- THEN split_part(s,'.',1) || '0'
+ WHEN pg_catalog.split_part(s,'.',1)::integer > 9
+ THEN pg_catalog.split_part(s,'.',1) || '0'
ELSE
- split_part(s,'.', 1) || split_part(s,'.', 2)
+ pg_catalog.split_part(s,'.', 1) || pg_catalog.split_part(s,'.', 2)
END
- FROM substring(version(), 'PostgreSQL ([0-9\.]+)') AS s )
+ FROM pg_catalog.substring(pg_catalog.version(), 'PostgreSQL ([0-9\.]+)') AS s )
THEN
RAISE EXCEPTION 'PostGIS built for PostgreSQL % cannot be loaded in PostgreSQL %',
POSTGIS_PGSQL_HR_VERSION, pgver;
@@ -52,7 +52,7 @@ DECLARE
rec RECORD;
BEGIN
FOR rec IN
- SELECT n.nspname, p.proname FROM pg_proc p, pg_namespace n
+ SELECT n.nspname, p.proname FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace n
WHERE p.proname = 'postgis_version'
AND p.pronamespace = n.oid
LOOP
@@ -2591,7 +2591,7 @@ BEGIN
-- We are using postgis_type_name to lookup the new name
-- (in case Paul changes his mind and flips geometry_columns to return old upper case name)
EXECUTE 'ALTER TABLE ' || quote_ident(real_schema) || '.' || quote_ident(table_name) ||
- ' ALTER COLUMN ' || quote_ident(column_name) || ' TYPE geometry(' || @extschema at .postgis_type_name(myrec.type, myrec.coord_dimension, true) || ', ' || new_srid::text || ') USING @extschema at .ST_SetSRID(' || quote_ident(column_name) || ',' || new_srid::text || ');' ;
+ ' ALTER COLUMN ' || pg_catalog.quote_ident(column_name) || ' TYPE geometry(' || @extschema at .postgis_type_name(myrec.type, myrec.coord_dimension, true) || ', ' || new_srid::text || ') USING @extschema at .ST_SetSRID(' || pg_catalog.quote_ident(column_name) || ',' || new_srid::text || ');' ;
END IF;
RETURN real_schema || '.' || table_name || '.' || column_name ||' SRID changed to ' || new_srid::text;
@@ -2788,8 +2788,8 @@ CREATE OR REPLACE FUNCTION _postgis_scripts_pgsql_version() RETURNS text
CREATE OR REPLACE FUNCTION _postgis_pgsql_version() RETURNS text
AS $$
- SELECT CASE WHEN split_part(s,'.',1)::integer > 9 THEN split_part(s,'.',1) || '0' ELSE split_part(s,'.', 1) || split_part(s,'.', 2) END AS v
- FROM substring(version(), 'PostgreSQL ([0-9\.]+)') AS s;
+ SELECT CASE WHEN pg_catalog.split_part(s,'.',1)::integer > 9 THEN pg_catalog.split_part(s,'.',1) || '0' ELSE pg_catalog.split_part(s,'.', 1) || pg_catalog.split_part(s,'.', 2) END AS v
+ FROM pg_catalog.substring(pg_catalog.version(), 'PostgreSQL ([0-9\.]+)') AS s;
$$ LANGUAGE 'sql' STABLE;
-- Availability: 2.5.0
@@ -2846,7 +2846,7 @@ BEGIN
--force install in same schema as postgis only if postgis extension is installed
IF rec.name NOT IN('postgis', 'postgis_topology', 'postgis_tiger_geocoder') AND EXISTS (SELECT 1 FROM pg_catalog.pg_extension WHERE extname = 'postgis') THEN
sql = 'CREATE EXTENSION ' || rec.name || ' FROM unpackaged SCHEMA '
- || quote_ident( (SELECT ns.nspname FROM pg_catalog.pg_extension AS e INNER JOIN pg_catalog.pg_namespace AS ns ON e.extnamespace = ns.oid WHERE extname = 'postgis')) || ';';
+ || pg_catalog.quote_ident( (SELECT ns.nspname FROM pg_catalog.pg_extension AS e INNER JOIN pg_catalog.pg_namespace AS ns ON e.extnamespace = ns.oid WHERE extname = 'postgis')) || ';';
ELSE
sql = 'CREATE EXTENSION ' || rec.name || ' FROM unpackaged;';
END IF;
@@ -2859,7 +2859,7 @@ BEGIN
ELSIF rec.default_version != rec.installed_version
THEN
sql = 'ALTER EXTENSION ' || rec.name || ' UPDATE TO ' ||
- quote_ident(rec.default_version) || ';';
+ pg_catalog.quote_ident(rec.default_version) || ';';
RAISE NOTICE 'Updating extension % from % to %',
rec.name, rec.installed_version, rec.default_version;
RAISE DEBUG '%', sql;
@@ -2871,11 +2871,11 @@ BEGIN
RAISE NOTICE 'Updating extension % %',
rec.name, rec.installed_version;
sql = 'ALTER EXTENSION ' || rec.name || ' UPDATE TO ' ||
- quote_ident(rec.default_version || 'next') || ';';
+ pg_catalog.quote_ident(rec.default_version || 'next') || ';';
RAISE DEBUG '%', sql;
EXECUTE sql;
sql = 'ALTER EXTENSION ' || rec.name || ' UPDATE TO ' ||
- quote_ident(rec.default_version) || ';';
+ pg_catalog.quote_ident(rec.default_version) || ';';
RAISE DEBUG '%', sql;
EXECUTE sql;
END IF;
@@ -2959,7 +2959,7 @@ BEGIN
END;
BEGIN
- SELECT postgis_raster_scripts_installed() INTO rast_scr_ver;
+ SELECT @extschema at .postgis_raster_scripts_installed() INTO rast_scr_ver;
EXCEPTION
WHEN undefined_function THEN
RAISE DEBUG 'Function postgis_raster_scripts_installed() not found. Is raster support enabled and rtpostgis.sql installed?';
diff --git a/postgis/postgis_after_upgrade.sql b/postgis/postgis_after_upgrade.sql
index 02f86920b..20c08204f 100644
--- a/postgis/postgis_after_upgrade.sql
+++ b/postgis/postgis_after_upgrade.sql
@@ -241,7 +241,7 @@ BEGIN
IF _postgis_scripts_pgsql_version()::integer >= 96 THEN
-- mark ST_Union agg as parallel safe if it is not already
BEGIN
- UPDATE pg_proc SET proparallel = 's'
+ UPDATE pg_catalog.pg_proc SET proparallel = 's'
WHERE oid = 'st_union(geometry)'::regprocedure AND proparallel = 'u';
EXCEPTION WHEN OTHERS THEN
RAISE DEBUG 'Could not update st_union(geometry): %', SQLERRM;
diff --git a/postgis/postgis_before_upgrade.sql b/postgis/postgis_before_upgrade.sql
index 5fdadad54..611e6108c 100644
--- a/postgis/postgis_before_upgrade.sql
+++ b/postgis/postgis_before_upgrade.sql
@@ -30,8 +30,8 @@
-- FROM pg_catalog.pg_proc p
-- LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace
-- WHERE
--- LOWER(n.nspname) = LOWER('public') AND
--- LOWER(p.proname) = LOWER('ST_AsGeoJson')
+-- pg_catalog.LOWER(n.nspname) = pg_catalog.LOWER('public') AND
+-- pg_catalog.LOWER(p.proname) = pg_catalog.LOWER('ST_AsGeoJson')
-- ORDER BY 1, 2, 3, 4;
CREATE OR REPLACE FUNCTION _postgis_drop_function_if_needed(
function_name text,
@@ -53,9 +53,9 @@ BEGIN
SELECT oid
FROM pg_catalog.pg_proc p
WHERE pronamespace = postgis_namespace
- AND LOWER(p.proname) = LOWER(function_name)
+ AND pg_catalog.LOWER(p.proname) = pg_catalog.LOWER(function_name)
AND pg_catalog.pg_function_is_visible(p.oid)
- AND LOWER(pg_catalog.pg_get_function_identity_arguments(p.oid)) ~ LOWER(function_arguments)
+ AND pg_catalog.LOWER(pg_catalog.pg_get_function_identity_arguments(p.oid)) ~ pg_catalog.LOWER(function_arguments)
INTO matching_function;
IF matching_function IS NOT NULL THEN
diff --git a/raster/rt_pg/rtpostgis.sql.in b/raster/rt_pg/rtpostgis.sql.in
index b5e7a093a..15414c346 100644
--- a/raster/rt_pg/rtpostgis.sql.in
+++ b/raster/rt_pg/rtpostgis.sql.in
@@ -47,7 +47,7 @@ DECLARE
rec RECORD;
BEGIN
FOR rec IN
- SELECT n.nspname, p.proname FROM pg_proc p, pg_namespace n
+ SELECT n.nspname, p.proname FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace n
WHERE p.proname = 'postgis_raster_lib_version'
AND p.pronamespace = n.oid
LOOP
@@ -63,11 +63,11 @@ DECLARE
nsp TEXT;
BEGIN
SELECT n.nspname
- INTO nsp FROM pg_proc p, pg_namespace n
+ INTO nsp FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace n
WHERE p.proname = 'postgis_lib_version'
AND p.pronamespace = n.oid;
- IF nsp != current_schema() THEN
+ IF nsp != pg_catalog.current_schema() THEN
RAISE EXCEPTION
'PostGIS Raster must be in the same schema as PostGIS (%)',
nsp;
@@ -7216,7 +7216,7 @@ CREATE OR REPLACE FUNCTION _raster_constraint_info_srid(rastschema name, rasttab
split_part(s.consrc, ' = ', 2),
'[\(\)]', '', 'g'
)::integer
- FROM pg_class c, pg_namespace n, pg_attribute a
+ FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n, pg_catalog.pg_attribute a
, (SELECT connamespace, conrelid, conkey, pg_get_constraintdef(oid) As consrc
FROM pg_constraint) AS s
WHERE n.nspname = $1
diff --git a/raster/rt_pg/rtpostgis_upgrade_cleanup.sql.in b/raster/rt_pg/rtpostgis_upgrade_cleanup.sql.in
index 0d6f3ba00..e31d74f76 100644
--- a/raster/rt_pg/rtpostgis_upgrade_cleanup.sql.in
+++ b/raster/rt_pg/rtpostgis_upgrade_cleanup.sql.in
@@ -94,11 +94,11 @@ BEGIN
IF NOT EXISTS (
SELECT
proname
- FROM pg_proc f
- JOIN pg_type r
+ FROM pg_catalog.pg_proc f
+ JOIN pg_catalog.pg_type r
ON r.typname = 'raster'
AND (f.proargtypes::oid[])[0] = r.oid
- JOIN pg_type g
+ JOIN pg_catalog.pg_type g
ON g.typname = 'geometry'
AND (f.proargtypes::oid[])[1] = g.oid
WHERE proname = 'raster_contained_by_geometry'
@@ -117,11 +117,11 @@ BEGIN
IF NOT EXISTS (
SELECT
proname
- FROM pg_proc f
- JOIN pg_type r
+ FROM pg_catalog.pg_proc f
+ JOIN pg_catalog.pg_type r
ON r.typname = 'raster'
AND (f.proargtypes::oid[])[1] = r.oid
- JOIN pg_type g
+ JOIN pg_catalog.pg_type g
ON g.typname = 'geometry'
AND (f.proargtypes::oid[])[0] = g.oid
WHERE proname = 'geometry_contained_by_raster'
@@ -362,8 +362,8 @@ CREATE OR REPLACE FUNCTION _rename_raster_tables()
cnt int;
BEGIN
SELECT count(*) INTO cnt
- FROM pg_class c
- JOIN pg_namespace n
+ FROM pg_catalog.pg_class c
+ JOIN pg_catalog.pg_namespace n
ON c.relnamespace = n.oid
WHERE c.relname = 'raster_columns'
AND c.relkind = 'r'::char
@@ -374,8 +374,8 @@ CREATE OR REPLACE FUNCTION _rename_raster_tables()
END IF;
SELECT count(*) INTO cnt
- FROM pg_class c
- JOIN pg_namespace n
+ FROM pg_catalog.pg_class c
+ JOIN pg_catalog.pg_namespace n
ON c.relnamespace = n.oid
WHERE c.relname = 'raster_overviews'
AND c.relkind = 'r'::char
@@ -417,8 +417,8 @@ CREATE OR REPLACE FUNCTION _drop_st_samealignment()
cnt int;
BEGIN
SELECT count(*) INTO cnt
- FROM pg_proc
- WHERE lower(proname) = 'st_samealignment'
+ FROM pg_catalog.pg_proc
+ WHERE pg_catalog.lower(proname) = 'st_samealignment'
AND pronargs = 2
AND (
proargnames = '{rasta,rastb}'::text[] OR
@@ -586,10 +586,10 @@ BEGIN
SELECT
count(*)
INTO cnt
- FROM pg_proc f
- JOIN pg_type t
+ FROM pg_catalog.pg_proc f
+ JOIN pg_catalog.pg_type t
ON f.prorettype = t.oid
- WHERE lower(f.proname) = '_raster_constraint_nodata_values'
+ WHERE pg_catalog.lower(f.proname) = '_raster_constraint_nodata_values'
AND f.pronargs = 1
AND t.typname = '_float8'; -- array form
diff --git a/topology/sql/manage/ManageHelper.sql.in b/topology/sql/manage/ManageHelper.sql.in
index 31b70756b..2acfd9c41 100644
--- a/topology/sql/manage/ManageHelper.sql.in
+++ b/topology/sql/manage/ManageHelper.sql.in
@@ -25,13 +25,13 @@ DECLARE
var_result text;
var_cur_search_path text;
BEGIN
- SELECT reset_val INTO var_cur_search_path FROM pg_settings WHERE name = 'search_path';
- IF var_cur_search_path LIKE '%' || quote_ident(a_schema_name) || '%' THEN
+ SELECT reset_val INTO var_cur_search_path FROM pg_catalog.pg_settings WHERE name = 'search_path';
+ 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
var_cur_search_path := var_cur_search_path || ', '
- || quote_ident(a_schema_name);
- EXECUTE 'ALTER DATABASE ' || quote_ident(current_database())
+ || pg_catalog.quote_ident(a_schema_name);
+ EXECUTE 'ALTER DATABASE ' || pg_catalog.quote_ident(pg_catalog.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;
diff --git a/utils/create_undef.pl b/utils/create_undef.pl
index 077c649b5..c59521192 100755
--- a/utils/create_undef.pl
+++ b/utils/create_undef.pl
@@ -261,10 +261,10 @@ DECLARE
BEGIN
FOR rec IN
SELECT n.nspname, c.relname, a.attname, t.typname
- FROM pg_attribute a
- JOIN pg_class c ON a.attrelid = c.oid
- JOIN pg_namespace n ON c.relnamespace = n.oid
- JOIN pg_type t ON a.atttypid = t.oid
+ FROM pg_catalog.pg_attribute a
+ JOIN pg_catalog.pg_class c ON a.attrelid = c.oid
+ JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid
+ JOIN pg_catalog.pg_type t ON a.atttypid = t.oid
WHERE t.typname = '$type'
AND NOT (
-- we exclude complexes defined as types
@@ -363,14 +363,14 @@ DECLARE
var_search_path text;
BEGIN
SELECT reset_val INTO var_search_path FROM pg_settings WHERE name = 'search_path';
- IF var_search_path NOT LIKE '%' || quote_ident(a_schema_name) || '%' THEN
+ IF var_search_path NOT LIKE '%' || pg_catalog.quote_ident(a_schema_name) || '%' THEN
var_result := a_schema_name || ' not in database search_path';
ELSE
- var_search_path := btrim( regexp_replace(
- replace(var_search_path, a_schema_name, ''), ', *,', ','),
+ var_search_path := pg_catalog.btrim( pg_catalog.regexp_replace(
+ pg_catalog.replace(var_search_path, a_schema_name, ''), ', *,', ','),
', ');
RAISE NOTICE 'New search_path: %', var_search_path;
- EXECUTE 'ALTER DATABASE ' || quote_ident(current_database()) || ' SET search_path = ' || var_search_path;
+ EXECUTE 'ALTER DATABASE ' || pg_catalog.quote_ident(pg_catalog.current_database()) || ' SET search_path = ' || var_search_path;
var_result := a_schema_name || ' has been stripped off database search_path ';
END IF;
diff --git a/utils/postgis_proc_upgrade.pl b/utils/postgis_proc_upgrade.pl
index d50436bc4..8c2761ac9 100755
--- a/utils/postgis_proc_upgrade.pl
+++ b/utils/postgis_proc_upgrade.pl
@@ -545,8 +545,8 @@ BEGIN
SELECT into old_scripts MODULE_scripts_installed();
END;
SELECT into new_scripts 'NEWVERSION';
- SELECT into old_maj substring(old_scripts from 1 for 1);
- SELECT into new_maj substring(new_scripts from 1 for 1);
+ SELECT into old_maj pg_catalog.substring(old_scripts, 1, 1);
+ SELECT into new_maj pg_catalog.substring(new_scripts, 1,1);
-- 2.x to 3.x was upgrade-compatible, see
-- https://trac.osgeo.org/postgis/ticket/4170#comment:1
@@ -567,11 +567,11 @@ CREATE TEMPORARY TABLE _postgis_upgrade_info AS WITH versions AS (
) SELECT
upgraded as scripts_upgraded,
installed as scripts_installed,
- substring(upgraded from '([0-9]*)\.')::int * 100 +
- substring(upgraded from '[0-9]*\.([0-9]*)\.')::int
+ pg_catalog.substring(upgraded, '([0-9]*)\.')::int * 100 +
+ pg_catalog.substring(upgraded, '[0-9]*\.([0-9]*)\.')::int
as version_to_num,
- substring(installed from '([0-9]*)\.')::int * 100 +
- substring(installed from '[0-9]*\.([0-9]*)\.')::int
+ pg_catalog.substring(installed, '([0-9]*)\.')::int * 100 +
+ pg_catalog.substring(installed, '[0-9]*\.([0-9]*)\.')::int
as version_from_num,
installed ~ 'dev|alpha|beta'
as version_from_isdev
-----------------------------------------------------------------------
Summary of changes:
NEWS | 4 +-
extensions/postgis/unpackage_raster_if_needed.sql | 4 +-
extensions/postgis_extension_helper.sql | 46 +++++++++++------------
extras/tiger_geocoder/utility/set_search_path.sql | 4 +-
postgis/postgis.sql.in | 28 +++++++-------
postgis/postgis_after_upgrade.sql | 2 +-
postgis/postgis_before_upgrade.sql | 8 ++--
raster/rt_pg/rtpostgis.sql.in | 8 ++--
raster/rt_pg/rtpostgis_upgrade_cleanup.sql.in | 30 +++++++--------
topology/sql/manage/ManageHelper.sql.in | 8 ++--
utils/create_undef.pl | 16 ++++----
utils/postgis_proc_upgrade.pl | 12 +++---
12 files changed, 86 insertions(+), 84 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list