[postgis-tickets] r16919 - Fix support for PostgreSQL-12 ("getrelid" macro removed)

Sandro Santilli strk at kbt.io
Wed Oct 17 07:27:23 PDT 2018


Author: strk
Date: 2018-10-17 07:27:23 -0700 (Wed, 17 Oct 2018)
New Revision: 16919

Modified:
   branches/2.4/NEWS
   branches/2.4/postgis/gserialized_estimate.c
Log:
Fix support for PostgreSQL-12 ("getrelid" macro removed)

The call is replaced with its expansion which should work
as back as PostgreSQL-9.1 which is before the oldest version
PostGIS-2.2 (our oldest maintained branch) supports.

This is then safe to backport to all branches till 2.2.

Patch by Laurenz Albe

References #4206 in 2.4 branch

Modified: branches/2.4/NEWS
===================================================================
--- branches/2.4/NEWS	2018-10-17 14:25:46 UTC (rev 16918)
+++ branches/2.4/NEWS	2018-10-17 14:27:23 UTC (rev 16919)
@@ -2,6 +2,7 @@
 2018/xx/xx
 
   * Bug Fixes and Enhancements
+
   - #4160, Use qualified names in topology extension install (Raúl Marín)
   - #4181, St_AsMVTGeom: Avoid type changes due to validation (Raúl Marín)
   - #4183, St_AsMVTGeom: Drop invalid geometries after simplification (Raúl Marín)
@@ -8,6 +9,7 @@
   - #4189, Fix undefined behaviour in SADFWrite (Raúl Marín)
   - #4191, Fix undefined behaviour in ptarray_clone_deep (Raúl Marín)
   - #4020, Fix leftovers in topology upgrade from 2.1 (Sandro Santilli)
+  - #4206, Fix support for PostgreSQL 12 dev branch (Laurenz Albe)
 
 
 PostGIS 2.4.5

Modified: branches/2.4/postgis/gserialized_estimate.c
===================================================================
--- branches/2.4/postgis/gserialized_estimate.c	2018-10-17 14:25:46 UTC (rev 16918)
+++ branches/2.4/postgis/gserialized_estimate.c	2018-10-17 14:27:23 UTC (rev 16919)
@@ -1256,8 +1256,8 @@
 	}
 
 	/* What are the Oids of our tables/relations? */
-	relid1 = getrelid(var1->varno, root->parse->rtable);
-	relid2 = getrelid(var2->varno, root->parse->rtable);
+	relid1 = rt_fetch(var1->varno, root->parse->rtable)->relid;
+	relid2 = rt_fetch(var2->varno, root->parse->rtable)->relid;
 
 	POSTGIS_DEBUGF(3, "using relations \"%s\" Oid(%d), \"%s\" Oid(%d)",
 	                 get_rel_name(relid1) ? get_rel_name(relid1) : "NULL", relid1, get_rel_name(relid2) ? get_rel_name(relid2) : "NULL", relid2);



More information about the postgis-tickets mailing list