pgsql: Revert SQL/JSON features
Revert SQL/JSON features
The reverts the following and makes some associated cleanups:
commit f79b803dc: Common SQL/JSON clauses
commit f4fb45d15: SQL/JSON constructors
commit 5f0adec25: Make STRING an unreserved_keyword.
commit 33a377608: IS JSON predicate
commit 1a36bc9db: SQL/JSON query functions
commit 606948b05: SQL JSON functions
commit 49082c2cc: RETURNING clause for JSON() and JSON_SCALAR()
commit 4e34747c8: JSON_TABLE
commit fadb48b00: PLAN clauses for JSON_TABLE
commit 2ef6f11b0: Reduce running time of jsonb_sqljson test
commit 14d3f24fa: Further improve jsonb_sqljson parallel test
commit a6baa4bad: Documentation for SQL/JSON features
commit b46bcf7a4: Improve readability of SQL/JSON documentation.
commit 112fdb352: Fix finalization for json_objectagg and friends
commit fcdb35c32: Fix transformJsonBehavior
commit 4cd8717af: Improve a couple of sql/json error messages
commit f7a605f63: Small cleanups in SQL/JSON code
commit 9c3d25e17: Fix JSON_OBJECTAGG uniquefying bug
commit a79153b7a: Claim SQL standard compliance for SQL/JSON features
commit a1e7616d6: Rework SQL/JSON documentation
commit 8d9f9634e: Fix errors in copyfuncs/equalfuncs support for JSON node types.
commit 3c633f32b: Only allow returning string types or bytea from json_serialize
commit 67b26703b: expression eval: Fix EEOP_JSON_CONSTRUCTOR and EEOP_JSONEXPR size.
The release notes are also adjusted.
Backpatch to release 15.
Discussion: /messages/by-id/40d2c882-bcac-19a9-754d-4299e1d87ac7@postgresql.org
Branch
------
REL_15_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/96ef3237bf741c12390003e90a4d7115c0c854b7
Modified Files
--------------
doc/src/sgml/func.sgml | 1065 +-----------
doc/src/sgml/keywords/sql2016-02-reserved.txt | 1 -
doc/src/sgml/release-15.sgml | 93 --
src/backend/catalog/sql_features.txt | 30 +-
src/backend/commands/explain.c | 8 +-
src/backend/executor/execExpr.c | 359 +----
src/backend/executor/execExprInterp.c | 743 ---------
src/backend/executor/nodeTableFuncscan.c | 23 +-
src/backend/jit/llvm/llvmjit_expr.c | 18 -
src/backend/jit/llvm/llvmjit_types.c | 3 -
src/backend/nodes/copyfuncs.c | 566 -------
src/backend/nodes/equalfuncs.c | 442 -----
src/backend/nodes/makefuncs.c | 122 --
src/backend/nodes/nodeFuncs.c | 486 ------
src/backend/nodes/outfuncs.c | 175 --
src/backend/nodes/readfuncs.c | 213 ---
src/backend/optimizer/path/costsize.c | 3 +-
src/backend/optimizer/util/clauses.c | 78 -
src/backend/parser/Makefile | 1 -
src/backend/parser/gram.y | 1115 +------------
src/backend/parser/parse_clause.c | 12 +-
src/backend/parser/parse_collate.c | 7 -
src/backend/parser/parse_expr.c | 1502 -----------------
src/backend/parser/parse_jsontable.c | 732 ---------
src/backend/parser/parse_relation.c | 7 +-
src/backend/parser/parse_target.c | 40 -
src/backend/parser/parser.c | 16 -
src/backend/utils/adt/format_type.c | 4 -
src/backend/utils/adt/formatting.c | 45 +-
src/backend/utils/adt/json.c | 553 +------
src/backend/utils/adt/jsonb.c | 352 +---
src/backend/utils/adt/jsonb_util.c | 39 +-
src/backend/utils/adt/jsonfuncs.c | 71 +-
src/backend/utils/adt/jsonpath.c | 257 ---
src/backend/utils/adt/jsonpath_exec.c | 844 +---------
src/backend/utils/adt/ruleutils.c | 719 +--------
src/backend/utils/misc/queryjumble.c | 72 -
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_aggregate.dat | 22 -
src/include/catalog/pg_proc.dat | 74 -
src/include/executor/execExpr.h | 98 --
src/include/executor/executor.h | 2 -
src/include/nodes/makefuncs.h | 12 -
src/include/nodes/nodes.h | 28 -
src/include/nodes/parsenodes.h | 287 ----
src/include/nodes/primnodes.h | 265 +--
src/include/parser/kwlist.h | 26 -
src/include/parser/parse_clause.h | 3 -
src/include/utils/formatting.h | 4 -
src/include/utils/json.h | 26 -
src/include/utils/jsonb.h | 33 -
src/include/utils/jsonfuncs.h | 7 -
src/include/utils/jsonpath.h | 37 -
src/interfaces/ecpg/preproc/ecpg.trailer | 41 +-
src/interfaces/ecpg/preproc/parse.pl | 2 -
src/interfaces/ecpg/preproc/parser.c | 14 -
src/test/regress/expected/json_sqljson.out | 24 -
src/test/regress/expected/jsonb_sqljson.out | 2135 -------------------------
src/test/regress/expected/opr_sanity.out | 6 +-
src/test/regress/expected/sqljson.out | 1320 ---------------
src/test/regress/parallel_schedule | 2 +-
src/test/regress/sql/json_sqljson.sql | 15 -
src/test/regress/sql/jsonb_sqljson.sql | 977 -----------
src/test/regress/sql/opr_sanity.sql | 6 +-
src/test/regress/sql/sqljson.sql | 471 ------
src/tools/pgindent/typedefs.list | 15 -
66 files changed, 350 insertions(+), 16420 deletions(-)
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
Re: To Andrew Dunstan
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.
Err sorry, my local build environment was still on beta3.
PostGIS 3.3.0 is broken now with 15beta4:
10:52:29 lwgeom_out_geojson.c:54:35: error: unknown type name ‘JsonTypeCategory’
10:52:29 54 | JsonTypeCategory tcategory, Oid outfuncoid,
10:52:29 | ^~~~~~~~~~~~~~~~
...
So, there is probably no issue here, but I suggest this "static" might
be considered to be removed again so PostGIS can use it.
I guess either PostgreSQL or PostGIS need to make a new release to fix that.
Christoph
On Wed, Sep 07, 2022 at 11:07:35AM +0200, Christoph Berg wrote:
I guess either PostgreSQL or PostGIS need to make a new release to fix that.
Postgis is already planning on it.
https://lists.osgeo.org/pipermail/postgis-devel/2022-September/thread.html
--
Justin
Re: Justin Pryzby
I guess either PostgreSQL or PostGIS need to make a new release to fix that.
Postgis is already planning on it.
https://lists.osgeo.org/pipermail/postgis-devel/2022-September/thread.html
Thanks. I was skimming the postgis-devel list, but did not read the
subjects carefully enough to spot it.
Christoph