[postgis-tickets] r17843 - Pg12 catalog table compatibility for upgrade

Paul Ramsey pramsey at cleverelephant.ca
Tue Oct 1 10:11:28 PDT 2019


Author: pramsey
Date: 2019-10-01 10:11:28 -0700 (Tue, 01 Oct 2019)
New Revision: 17843

Modified:
   branches/2.4/raster/rt_pg/rtpostgis.sql.in
Log:
Pg12 catalog table compatibility for upgrade
References #4516


Modified: branches/2.4/raster/rt_pg/rtpostgis.sql.in
===================================================================
--- branches/2.4/raster/rt_pg/rtpostgis.sql.in	2019-10-01 14:30:51 UTC (rev 17842)
+++ branches/2.4/raster/rt_pg/rtpostgis.sql.in	2019-10-01 17:11:28 UTC (rev 17843)
@@ -7301,8 +7301,8 @@
 	RETURNS boolean AS $$
 	SELECT
 		TRUE
-	FROM pg_class c, pg_namespace n, pg_attribute a, (SELECT connamespace, conrelid, conkey, pg_get_constraintdef(oid) As consrc
-			FROM pg_constraint) s, pg_index idx, pg_operator op
+	FROM pg_class c, pg_namespace n, pg_attribute a, (SELECT connamespace, conrelid, conexclop, conindid, conkey, pg_get_constraintdef(oid) As consrc
+			FROM pg_constraint WHERE contype = 'x') s, pg_index idx, pg_operator op
 	WHERE n.nspname = $1
 		AND c.relname = $2
 		AND a.attname = $3
@@ -7309,11 +7309,10 @@
 		AND a.attrelid = c.oid
 		AND s.connamespace = n.oid
 		AND s.conrelid = c.oid
-		AND s.contype = 'x'
+		AND s.conexclop[1] = op.oid
 		AND 0::smallint = ANY (s.conkey)
 		AND idx.indexrelid = s.conindid
 		AND pg_get_indexdef(idx.indexrelid, 1, true) LIKE '(' || quote_ident($3) || '::%geometry)'
-		AND s.conexclop[1] = op.oid
 		AND op.oprname = '=';
 	$$ LANGUAGE sql STABLE STRICT
   COST 100;
@@ -7350,8 +7349,8 @@
 	BEGIN
 		SELECT
 			s.conname INTO cn
-		FROM pg_class c, pg_namespace n, pg_attribute a, (SELECT connamespace, conrelid, conkey, pg_get_constraintdef(oid) As consrc
-			FROM pg_constraint) s, pg_index idx, pg_operator op
+		FROM pg_class c, pg_namespace n, pg_attribute a, (SELECT connamespace, conrelid, conkey, conexclop, conindid, pg_get_constraintdef(oid) As consrc
+			FROM pg_constraint WHERE contype = 'x') s, pg_index idx, pg_operator op
 		WHERE n.nspname = $1
 			AND c.relname = $2
 			AND a.attname = $3
@@ -7358,7 +7357,6 @@
 			AND a.attrelid = c.oid
 			AND s.connamespace = n.oid
 			AND s.conrelid = c.oid
-			AND s.contype = 'x'
 			AND 0::smallint = ANY (s.conkey)
 			AND idx.indexrelid = s.conindid
 			AND pg_get_indexdef(idx.indexrelid, 1, true) LIKE '(' || quote_ident($3) || '::%geometry)'



More information about the postgis-tickets mailing list