[postgis-devel] PostGIS and json_categorize_type (Re: pgsql: Revert SQL/JSON features)

Christoph Berg myon at debian.org
Wed Sep 7 02:01:22 PDT 2022


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: undefined symbol: 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


More information about the postgis-devel mailing list