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

Sandro Santilli strk at kbt.io
Wed Oct 17 07:28:02 PDT 2018


Author: strk
Date: 2018-10-17 07:28:02 -0700 (Wed, 17 Oct 2018)
New Revision: 16920

Modified:
   branches/2.3/NEWS
   branches/2.3/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.3 branch

Modified: branches/2.3/NEWS
===================================================================
--- branches/2.3/NEWS	2018-10-17 14:27:23 UTC (rev 16919)
+++ branches/2.3/NEWS	2018-10-17 14:28:02 UTC (rev 16920)
@@ -12,6 +12,7 @@
   - #4191, Fix undefined behaviour in ptarray_clone_deep (Raúl Marín)
   - #4020, Fix leftovers in topology upgrade from 2.1 (Sandro Santilli)
   - #4203, Fix build with GNU Make 4.1 (Sandro Santilli)
+  - #4206, Fix support for PostgreSQL 12 dev branch (Laurenz Albe)
 
 PostGIS 2.3.7
 2018/04/06

Modified: branches/2.3/postgis/gserialized_estimate.c
===================================================================
--- branches/2.3/postgis/gserialized_estimate.c	2018-10-17 14:27:23 UTC (rev 16919)
+++ branches/2.3/postgis/gserialized_estimate.c	2018-10-17 14:28:02 UTC (rev 16920)
@@ -1246,8 +1246,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