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

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


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

Modified:
   branches/2.2/NEWS
   branches/2.2/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

Closes #4206 in 2.2 branch

Modified: branches/2.2/NEWS
===================================================================
--- branches/2.2/NEWS	2018-10-17 14:28:02 UTC (rev 16920)
+++ branches/2.2/NEWS	2018-10-17 14:28:41 UTC (rev 16921)
@@ -8,6 +8,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.2.7
 2018/04/06

Modified: branches/2.2/postgis/gserialized_estimate.c
===================================================================
--- branches/2.2/postgis/gserialized_estimate.c	2018-10-17 14:28:02 UTC (rev 16920)
+++ branches/2.2/postgis/gserialized_estimate.c	2018-10-17 14:28:41 UTC (rev 16921)
@@ -1184,8 +1184,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