Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#4206 closed patch (fixed)

"getrelid" removed in PostgreSQL v12devel

Reported by: laurenz Owned by: strk
Priority: medium Milestone: PostGIS 3.0.0
Component: build Version: master
Keywords: getrelid Cc:

Description

The attached patch is required to build with PostgreSQL v12devel since commit d73f4c74dd34b19c19839f7ae09fb96442728509 removed getrelid.

Attachments (1)

getrelid-is-gone.patch (737 bytes ) - added by laurenz 6 years ago.
Patch to fix building in the absence of "getrelid"

Download all attachments as: .zip

Change History (8)

by laurenz, 6 years ago

Attachment: getrelid-is-gone.patch added

Patch to fix building in the absence of "getrelid"

comment:1 by laurenz, 6 years ago

Keywords: getrelid added

comment:2 by strk, 6 years ago

I suggest you keep the getrelid and use a macro which either calls "getrelid" or "rt_fetch" based on what's available based on PG_VERSION_NUM

comment:3 by laurenz, 6 years ago

I only checked back to PostgreSQL 9.1, but getrelid has always been a macro:

/*
 *      getrelid
 *
 *      Given the range index of a relation, return the corresponding
 *      relation OID.  Note that InvalidOid will be returned if the
 *      RTE is for a non-relation-type RTE.
 */
#define getrelid(rangeindex,rangetable) \
    (rt_fetch(rangeindex, rangetable)->relid)

So I think it is safe and actually an improvement to call rt_fetch directly.

comment:4 by strk, 6 years ago

In 16919:

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

comment:5 by strk, 6 years ago

In 16920:

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

comment:6 by strk, 6 years ago

Resolution: fixed
Status: newclosed

In 16921:

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

comment:7 by strk, 6 years ago

For the record (as I wrote the wrong ticket references in commit logs): the 2.5 branch was fixed with r16918 and trunk (2.6) with r16917

Note: See TracTickets for help on using tickets.