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

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


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

Modified:
   trunk/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 #4306 in trunk

Modified: trunk/postgis/gserialized_estimate.c
===================================================================
--- trunk/postgis/gserialized_estimate.c	2018-10-16 22:24:18 UTC (rev 16916)
+++ trunk/postgis/gserialized_estimate.c	2018-10-17 14:23:59 UTC (rev 16917)
@@ -1304,8 +1304,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