PostGIS and json_categorize_type (Re: pgsql: Revert SQL/JSON features) - Mailing list pgsql-hackers

From Christoph Berg
Subject PostGIS and json_categorize_type (Re: pgsql: Revert SQL/JSON features)
Date
Msg-id Yxhd4gw1xJP+SsDe@msg.df7cb.de
Whole thread Raw
Responses Re: PostGIS and json_categorize_type (Re: pgsql: Revert SQL/JSON features)
List pgsql-hackers
Re: Andrew Dunstan
> Revert SQL/JSON features
> 
> The reverts the following and makes some associated cleanups:

-void
+static void
 json_categorize_type(Oid typoid,
                     JsonTypeCategory *tcategory,
                     Oid *outfuncoid)

This chunk broke PostGIS 3.3.0 compiled with 15beta3, when used with
15beta4:

psql -Xc 'CREATE EXTENSION postgis'
ERROR:  could not load library "/usr/lib/postgresql/15/lib/postgis-3.so": /usr/lib/postgresql/15/lib/postgis-3.so:
undefinedsymbol: json_categorize_type
 

The PostGIS source has this comment:

 * The following code was all cut and pasted directly from
 * json.c from the Postgres source tree as of 2019-03-28.
 * It would be far better if these were exported from the
 * backend so we could just use them here. Maybe someday.
 * Sequel: 2022-04-04 That some day finally came in PG15
...
#if POSTGIS_PGSQL_VERSION < 170
static void
json_categorize_type(Oid typoid,
                     JsonTypeCategory *tcategory,
                     Oid *outfuncoid)

The "< 17" part was added on 2022-09-03, probably because of this
breakage.

Recompiling the (unmodified) 3.3.0 against 15beta4 seems to fix the
problem.

So, there is probably no issue here, but I suggest this "static" might
be considered to be removed again so PostGIS can use it.

Christoph



pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: Tracking last scan time
Next
From: Amit Kapila
Date:
Subject: Re: Handle infinite recursion in logical replication setup