Opened 2 years ago

Closed 2 years ago

Last modified 23 months ago

#5123 closed defect (fixed)

PostgreSQL 15 build is broken - jsonb failures

Reported by: robe Owned by: pramsey
Priority: blocker Milestone: PostGIS 3.3.0
Component: postgis Version: 3.2.x
Keywords: Cc:

Description

I assume this is the result of the new json features that landed in PostgreSQL 15 recently.

Debbie is unhappy.

19:43:46    38 |  JSONTYPE_NULL,    /* null, so we didn't bother to identify */
19:43:46       |  ^~~~~~~~~~~~~
19:43:46 In file included from lwgeom_out_geojson.c:21:
19:43:46 /var/lib/jenkins/workspace/pg/rel/pg15w64/include/postgresql/server/utils/json.h:21:2: note: previous definition of ‘JSONTYPE_NULL’ was here
19:43:46    21 |  JSONTYPE_NULL,    /* null, so we didn't bother to identify */
19:43:46       |  ^~~~~~~~~~~~~
19:43:46 lwgeom_out_geojson.c:39:2: error: redeclaration of enumerator ‘JSONTYPE_BOOL’
19:43:46    39 |  JSONTYPE_BOOL,    /* boolean (built-in types only) */
19:43:46       |  ^~~~~~~~~~~~~
19:43:46 In file included from lwgeom_out_geojson.c:21:
19:43:46 /var/lib/jenkins/workspace/pg/rel/pg15w64/include/postgresql/server/utils/json.h:22:2: note: previous definition of ‘JSONTYPE_BOOL’ was here
19:43:46    22 |  JSONTYPE_BOOL,    /* boolean (built-in types only) */
19:43:46       |  ^~~~~~~~~~~~~
19:43:46 lwgeom_out_geojson.c:40:2: error: redeclaration of enumerator ‘JSONTYPE_NUMERIC’
19:43:46    40 |  JSONTYPE_NUMERIC,   /* numeric (ditto) */
19:43:46       |  ^~~~~~~~~~~~~~~~
19:43:46 In file included from lwgeom_out_geojson.c:21:
19:43:46 /var/lib/jenkins/workspace/pg/rel/pg15w64/include/postgresql/server/utils/json.h:23:2: note: previous definition of ‘JSONTYPE_NUMERIC’ was here
19:43:46    23 |  JSONTYPE_NUMERIC,   /* numeric (ditto) */
19:43:46       |  ^~~~~~~~~~~~~~~~
19:43:46 lwgeom_out_geojson.c:41:2: error: redeclaration of enumerator ‘JSONTYPE_DATE’
19:43:46    41 |  JSONTYPE_DATE,    /* we use special formatting for datetimes */
19:43:46       |  ^~~~~~~~~~~~~
19:43:46 In file included from lwgeom_out_geojson.c:21:
19:43:46 /var/lib/jenkins/workspace/pg/rel/pg15w64/include/postgresql/server/utils/json.h:24:2: note: previous definition of ‘JSONTYPE_DATE’ was here
19:43:46    24 |  JSONTYPE_DATE,    /* we use special formatting for datetimes */
19:43:46       |  ^~~~~~~~~~~~~
19:43:46 lwgeom_out_geojson.c:42:2: error: redeclaration of enumerator ‘JSONTYPE_TIMESTAMP’
19:43:46    42 |  JSONTYPE_TIMESTAMP,
19:43:46       |  ^~~~~~~~~~~~~~~~~~
19:43:46 In file included from lwgeom_out_geojson.c:21:
19:43:46 /var/lib/jenkins/workspace/pg/rel/pg15w64/include/postgresql/server/utils/json.h:25:2: note: previous definition of ‘JSONTYPE_TIMESTAMP’ was here
19:43:46    25 |  JSONTYPE_TIMESTAMP,
19:43:46       |  ^~~~~~~~~~~~~~~~~~
19:43:46 lwgeom_out_geojson.c:43:2: error: redeclaration of enumerator ‘JSONTYPE_TIMESTAMPTZ’
19:43:46    43 |  JSONTYPE_TIMESTAMPTZ,
19:43:46       |  ^~~~~~~~~~~~~~~~~~~~
19:43:46 In file included from lwgeom_out_geojson.c:21:
19:43:46 /var/lib/jenkins/workspace/pg/rel/pg15w64/include/postgresql/server/utils/json.h:26:2: note: previous definition of ‘JSONTYPE_TIMESTAMPTZ’ was here
19:43:46    26 |  JSONTYPE_TIMESTAMPTZ,
19:43:46       |  ^~~~~~~~~~~~~~~~~~~~
19:43:46 lwgeom_out_geojson.c:44:2: error: redeclaration of enumerator ‘JSONTYPE_JSON’
19:43:46    44 |  JSONTYPE_JSON,    /* JSON itself (and JSONB) */
19:43:46       |  ^~~~~~~~~~~~~
19:43:46 In file included from lwgeom_out_geojson.c:21:
19:43:46 /var/lib/jenkins/workspace/pg/rel/pg15w64/include/postgresql/server/utils/json.h:27:2: note: previous definition of ‘JSONTYPE_JSON’ was here
19:43:46    27 |  JSONTYPE_JSON,    /* JSON itself (and JSONB) */
19:43:46       |  ^~~~~~~~~~~~~
19:43:46 lwgeom_out_geojson.c:45:2: error: redeclaration of enumerator ‘JSONTYPE_ARRAY’
19:43:46    45 |  JSONTYPE_ARRAY,    /* array */
19:43:46       |  ^~~~~~~~~~~~~~
19:43:46 In file included from lwgeom_out_geojson.c:21:
19:43:46 /var/lib/jenkins/workspace/pg/rel/pg15w64/include/postgresql/server/utils/json.h:28:2: note: previous definition of ‘JSONTYPE_ARRAY’ was here
19:43:46    28 |  JSONTYPE_ARRAY,    /* array */
19:43:46       |  ^~~~~~~~~~~~~~
19:43:46 lwgeom_out_geojson.c:46:2: error: redeclaration of enumerator ‘JSONTYPE_COMPOSITE’
19:43:46    46 |  JSONTYPE_COMPOSITE,   /* composite */
19:43:46       |  ^~~~~~~~~~~~~~~~~~
19:43:46 In file included from lwgeom_out_geojson.c:21:
19:43:46 /var/lib/jenkins/workspace/pg/rel/pg15w64/include/postgresql/server/utils/json.h:29:2: note: previous definition of ‘JSONTYPE_COMPOSITE’ was here
19:43:46    29 |  JSONTYPE_COMPOSITE,   /* composite */
19:43:46       |  ^~~~~~~~~~~~~~~~~~
19:43:46 lwgeom_out_geojson.c:47:2: error: redeclaration of enumerator ‘JSONTYPE_CAST’
19:43:46    47 |  JSONTYPE_CAST,    /* something with an explicit cast to JSON */
19:43:46       |  ^~~~~~~~~~~~~
19:43:46 In file included from lwgeom_out_geojson.c:21:
19:43:46 /var/lib/jenkins/workspace/pg/rel/pg15w64/include/postgresql/server/utils/json.h:30:2: note: previous definition of ‘JSONTYPE_CAST’ was here
19:43:46    30 |  JSONTYPE_CAST,    /* something with an explicit cast to JSON */
19:43:46       |  ^~~~~~~~~~~~~
19:43:46 lwgeom_out_geojson.c:48:2: error: redeclaration of enumerator ‘JSONTYPE_OTHER’
19:43:46    48 |  JSONTYPE_OTHER    /* all else */
19:43:46       |  ^~~~~~~~~~~~~~
19:43:46 In file included from lwgeom_out_geojson.c:21:
19:43:46 /var/lib/jenkins/workspace/pg/rel/pg15w64/include/postgresql/server/utils/json.h:31:2: note: previous definition of ‘JSONTYPE_OTHER’ was here
19:43:46    31 |  JSONTYPE_OTHER    /* all else */
19:43:46       |  ^~~~~~~~~~~~~~
19:43:46 lwgeom_out_geojson.c:49:3: error: conflicting types for ‘JsonTypeCategory’
19:43:46    49 | } JsonTypeCategory;
19:43:46       |   ^~~~~~~~~~~~~~~~
19:43:46 In file included from lwgeom_out_geojson.c:21:
19:43:46 /var/lib/jenkins/workspace/pg/rel/pg15w64/include/postgresql/server/utils/json.h:32:3: note: previous declaration of ‘JsonTypeCategory’ was here
19:43:46    32 | } JsonTypeCategory;
19:43:46       |   ^~~~~~~~~~~~~~~~
19:43:46 lwgeom_out_geojson.c:70:13: error: conflicting types for ‘json_categorize_type’
19:43:46    70 | static void json_categorize_type(Oid typoid,
19:43:46       |             ^~~~~~~~~~~~~~~~~~~~
19:43:46 In file included from lwgeom_out_geojson.c:21:
19:43:46 /var/lib/jenkins/workspace/pg/rel/pg15w64/include/postgresql/server/utils/json.h:39:13: note: previous declaration of ‘json_categorize_type’ was here
19:43:46    39 | extern void json_categorize_type(Oid typoid, JsonTypeCategory *tcategory,
19:43:46       |             ^~~~~~~~~~~~~~~~~~~~
19:43:46 make[1]: *** [<builtin>: lwgeom_out_geojson.o] Error 1
19:43:46 make[1]: Leaving directory '/var/lib/jenkins/workspace/postgis/branches/3.3/postgis'
19:43:46 make: *** [GNUmakefile:24: all] Error 1
19:43:46 Build step 'Execute shell' marked build as failure

I think the failures were introduced by I assume the SQL JSON one that was part of this run

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=606948b058dc16bce494270eea577011a602810e

	Changes

    Fix possible NULL-pointer-deference in backup_compression.c. (details)
    SQL JSON functions (details) 606948b058dc16bce494270eea577011a602810e
    Optimize order of GROUP BY keys (details)

Change History (6)

comment:1 by Regina Obe <lr@…>, 2 years ago

In 3af5602/git:

Fix compile against PG15. References #5123 for PostGIS 3.3

comment:2 by Regina Obe <lr@…>, 2 years ago

In 9870fd4/git:

Fix compile against PG15. Took out too much last time. References #5123 for PostGIS 3.3

comment:3 by robe, 2 years ago

okay this still needs some work, now getting error:

23:51:56 psql:/var/lib/jenkins/workspace/postgis/branches/3.3/regress/00-regress-install/share/contrib/postgis/postgis.sql:4796: ERROR:  syntax error at or near "("
23:51:56 LINE 1: CREATE OR REPLACE FUNCTION json(geometry)
23:51:56                                        ^
23:51:56 -----------------------------------------------------------------------------
23:51:56  failed (Error encountered loading /var/lib/jenkins/workspace/postgis/branches/3.3/regress/00-regress-install/share/contrib/postgis/postgis_comments.sql: /var/lib/jenkins/workspace/postgis/tmp/3_3_pg15w64/regress_log)

comment:4 by Regina Obe <lr@…>, 2 years ago

In 83faf96/git:

Fix compile against PG15. json and jsonb are now keywords so must be quoted as function names. References #5123 for PostGIS 3.3

comment:5 by Regina Obe <lr@…>, 2 years ago

Resolution: fixed
Status: newclosed

In 6225a9a6/git:

Fix compile against PG15

  1. json. json and jsonb are now keywords so must be quoted as function names
  2. json functions now exposed in api so exclude from code for PG15.

Closes #5123 for PostGIS 3.2

Note: See TracTickets for help on using tickets.