]> granicus.if.org Git - postgis/commitdiff
Fix support for PostgreSQL-12 ("getrelid" macro removed)
authorSandro Santilli <strk@kbt.io>
Wed, 17 Oct 2018 14:23:59 +0000 (14:23 +0000)
committerSandro Santilli <strk@kbt.io>
Wed, 17 Oct 2018 14:23:59 +0000 (14:23 +0000)
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

git-svn-id: http://svn.osgeo.org/postgis/trunk@16917 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/gserialized_estimate.c

index 39ee94992463d655673777e425d717156de0c3e0..76693d286b874d856059b63c01c7e9f0c48c59aa 100644 (file)
@@ -1304,8 +1304,8 @@ Datum gserialized_gist_joinsel(PG_FUNCTION_ARGS)
        }
 
        /* 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);