1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-29 23:43:17 +03:00

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: https://postgr.es/m/40d2c882-bcac-19a9-754d-4299e1d87ac7@postgresql.org
This commit is contained in:
Andrew Dunstan
2022-09-01 17:09:46 -04:00
parent c4e861b7bb
commit 96ef3237bf
66 changed files with 350 additions and 16420 deletions

View File

@@ -1398,7 +1398,6 @@ _copyTableFunc(const TableFunc *from)
{
TableFunc *newnode = makeNode(TableFunc);
COPY_SCALAR_FIELD(functype);
COPY_NODE_FIELD(ns_uris);
COPY_NODE_FIELD(ns_names);
COPY_NODE_FIELD(docexpr);
@@ -1409,9 +1408,7 @@ _copyTableFunc(const TableFunc *from)
COPY_NODE_FIELD(colcollations);
COPY_NODE_FIELD(colexprs);
COPY_NODE_FIELD(coldefexprs);
COPY_NODE_FIELD(colvalexprs);
COPY_BITMAPSET_FIELD(notnulls);
COPY_NODE_FIELD(plan);
COPY_SCALAR_FIELD(ordinalitycol);
COPY_LOCATION_FIELD(location);
@@ -2306,485 +2303,6 @@ _copyOnConflictExpr(const OnConflictExpr *from)
return newnode;
}
/*
* _copyJsonFormat
*/
static JsonFormat *
_copyJsonFormat(const JsonFormat *from)
{
JsonFormat *newnode = makeNode(JsonFormat);
COPY_SCALAR_FIELD(format_type);
COPY_SCALAR_FIELD(encoding);
COPY_LOCATION_FIELD(location);
return newnode;
}
/*
* _copyJsonReturning
*/
static JsonReturning *
_copyJsonReturning(const JsonReturning *from)
{
JsonReturning *newnode = makeNode(JsonReturning);
COPY_NODE_FIELD(format);
COPY_SCALAR_FIELD(typid);
COPY_SCALAR_FIELD(typmod);
return newnode;
}
/*
* _copyJsonValueExpr
*/
static JsonValueExpr *
_copyJsonValueExpr(const JsonValueExpr *from)
{
JsonValueExpr *newnode = makeNode(JsonValueExpr);
COPY_NODE_FIELD(raw_expr);
COPY_NODE_FIELD(formatted_expr);
COPY_NODE_FIELD(format);
return newnode;
}
/*
* _copyJsonParseExpr
*/
static JsonParseExpr *
_copyJsonParseExpr(const JsonParseExpr *from)
{
JsonParseExpr *newnode = makeNode(JsonParseExpr);
COPY_NODE_FIELD(expr);
COPY_NODE_FIELD(output);
COPY_SCALAR_FIELD(unique_keys);
COPY_LOCATION_FIELD(location);
return newnode;
}
/*
* _copyJsonScalarExpr
*/
static JsonScalarExpr *
_copyJsonScalarExpr(const JsonScalarExpr *from)
{
JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
COPY_NODE_FIELD(expr);
COPY_NODE_FIELD(output);
COPY_LOCATION_FIELD(location);
return newnode;
}
/*
* _copyJsonSerializeExpr
*/
static JsonSerializeExpr *
_copyJsonSerializeExpr(const JsonSerializeExpr *from)
{
JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
COPY_NODE_FIELD(expr);
COPY_NODE_FIELD(output);
COPY_LOCATION_FIELD(location);
return newnode;
}
/*
* _copyJsonConstructorExpr
*/
static JsonConstructorExpr *
_copyJsonConstructorExpr(const JsonConstructorExpr *from)
{
JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
COPY_SCALAR_FIELD(type);
COPY_NODE_FIELD(args);
COPY_NODE_FIELD(func);
COPY_NODE_FIELD(coercion);
COPY_NODE_FIELD(returning);
COPY_SCALAR_FIELD(absent_on_null);
COPY_SCALAR_FIELD(unique);
COPY_LOCATION_FIELD(location);
return newnode;
}
/*
* _copyJsonKeyValue
*/
static JsonKeyValue *
_copyJsonKeyValue(const JsonKeyValue *from)
{
JsonKeyValue *newnode = makeNode(JsonKeyValue);
COPY_NODE_FIELD(key);
COPY_NODE_FIELD(value);
return newnode;
}
/*
* _copyJsonObjectConstructor
*/
static JsonObjectConstructor *
_copyJsonObjectConstructor(const JsonObjectConstructor *from)
{
JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
COPY_NODE_FIELD(exprs);
COPY_NODE_FIELD(output);
COPY_SCALAR_FIELD(absent_on_null);
COPY_SCALAR_FIELD(unique);
COPY_LOCATION_FIELD(location);
return newnode;
}
/*
* _copyJsonAggConstructor
*/
static JsonAggConstructor *
_copyJsonAggConstructor(const JsonAggConstructor *from)
{
JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
COPY_NODE_FIELD(output);
COPY_NODE_FIELD(agg_filter);
COPY_NODE_FIELD(agg_order);
COPY_NODE_FIELD(over);
COPY_LOCATION_FIELD(location);
return newnode;
}
/*
* _copyJsonObjectAgg
*/
static JsonObjectAgg *
_copyJsonObjectAgg(const JsonObjectAgg *from)
{
JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
COPY_NODE_FIELD(constructor);
COPY_NODE_FIELD(arg);
COPY_SCALAR_FIELD(absent_on_null);
COPY_SCALAR_FIELD(unique);
return newnode;
}
/*
* _copyJsonOutput
*/
static JsonOutput *
_copyJsonOutput(const JsonOutput *from)
{
JsonOutput *newnode = makeNode(JsonOutput);
COPY_NODE_FIELD(typeName);
COPY_NODE_FIELD(returning);
return newnode;
}
/*
* _copyJsonArrayConstructor
*/
static JsonArrayConstructor *
_copyJsonArrayConstructor(const JsonArrayConstructor *from)
{
JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
COPY_NODE_FIELD(exprs);
COPY_NODE_FIELD(output);
COPY_SCALAR_FIELD(absent_on_null);
COPY_LOCATION_FIELD(location);
return newnode;
}
/*
* _copyJsonArrayAgg
*/
static JsonArrayAgg *
_copyJsonArrayAgg(const JsonArrayAgg *from)
{
JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
COPY_NODE_FIELD(constructor);
COPY_NODE_FIELD(arg);
COPY_SCALAR_FIELD(absent_on_null);
return newnode;
}
/*
* _copyJsonArrayQueryConstructor
*/
static JsonArrayQueryConstructor *
_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
{
JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
COPY_NODE_FIELD(query);
COPY_NODE_FIELD(output);
COPY_NODE_FIELD(format);
COPY_SCALAR_FIELD(absent_on_null);
COPY_LOCATION_FIELD(location);
return newnode;
}
/*
* _copyJsonExpr
*/
static JsonExpr *
_copyJsonExpr(const JsonExpr *from)
{
JsonExpr *newnode = makeNode(JsonExpr);
COPY_SCALAR_FIELD(op);
COPY_NODE_FIELD(formatted_expr);
COPY_NODE_FIELD(result_coercion);
COPY_NODE_FIELD(format);
COPY_NODE_FIELD(path_spec);
COPY_NODE_FIELD(passing_names);
COPY_NODE_FIELD(passing_values);
COPY_NODE_FIELD(returning);
COPY_NODE_FIELD(on_empty);
COPY_NODE_FIELD(on_error);
COPY_NODE_FIELD(coercions);
COPY_SCALAR_FIELD(wrapper);
COPY_SCALAR_FIELD(omit_quotes);
COPY_LOCATION_FIELD(location);
return newnode;
}
/*
* _copyJsonCoercion
*/
static JsonCoercion *
_copyJsonCoercion(const JsonCoercion *from)
{
JsonCoercion *newnode = makeNode(JsonCoercion);
COPY_NODE_FIELD(expr);
COPY_SCALAR_FIELD(via_populate);
COPY_SCALAR_FIELD(via_io);
COPY_SCALAR_FIELD(collation);
return newnode;
}
/*
* _copyJsonItemCoercions
*/
static JsonItemCoercions *
_copyJsonItemCoercions(const JsonItemCoercions *from)
{
JsonItemCoercions *newnode = makeNode(JsonItemCoercions);
COPY_NODE_FIELD(null);
COPY_NODE_FIELD(string);
COPY_NODE_FIELD(numeric);
COPY_NODE_FIELD(boolean);
COPY_NODE_FIELD(date);
COPY_NODE_FIELD(time);
COPY_NODE_FIELD(timetz);
COPY_NODE_FIELD(timestamp);
COPY_NODE_FIELD(timestamptz);
COPY_NODE_FIELD(composite);
return newnode;
}
/*
* _copyJsonFuncExpr
*/
static JsonFuncExpr *
_copyJsonFuncExpr(const JsonFuncExpr *from)
{
JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
COPY_SCALAR_FIELD(op);
COPY_NODE_FIELD(common);
COPY_NODE_FIELD(output);
COPY_NODE_FIELD(on_empty);
COPY_NODE_FIELD(on_error);
COPY_SCALAR_FIELD(wrapper);
COPY_SCALAR_FIELD(omit_quotes);
COPY_LOCATION_FIELD(location);
return newnode;
}
/*
* _copyJsonIsPredicate
*/
static JsonIsPredicate *
_copyJsonIsPredicate(const JsonIsPredicate *from)
{
JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
COPY_NODE_FIELD(expr);
COPY_NODE_FIELD(format);
COPY_SCALAR_FIELD(item_type);
COPY_SCALAR_FIELD(unique_keys);
COPY_LOCATION_FIELD(location);
return newnode;
}
/*
* _copyJsonBehavior
*/
static JsonBehavior *
_copyJsonBehavior(const JsonBehavior *from)
{
JsonBehavior *newnode = makeNode(JsonBehavior);
COPY_SCALAR_FIELD(btype);
COPY_NODE_FIELD(default_expr);
return newnode;
}
/*
* _copyJsonCommon
*/
static JsonCommon *
_copyJsonCommon(const JsonCommon *from)
{
JsonCommon *newnode = makeNode(JsonCommon);
COPY_NODE_FIELD(expr);
COPY_NODE_FIELD(pathspec);
COPY_STRING_FIELD(pathname);
COPY_NODE_FIELD(passing);
COPY_LOCATION_FIELD(location);
return newnode;
}
/*
* _copyJsonArgument
*/
static JsonArgument *
_copyJsonArgument(const JsonArgument *from)
{
JsonArgument *newnode = makeNode(JsonArgument);
COPY_NODE_FIELD(val);
COPY_STRING_FIELD(name);
return newnode;
}
/*
* _copyJsonTable
*/
static JsonTable *
_copyJsonTable(const JsonTable *from)
{
JsonTable *newnode = makeNode(JsonTable);
COPY_NODE_FIELD(common);
COPY_NODE_FIELD(columns);
COPY_NODE_FIELD(plan);
COPY_NODE_FIELD(on_error);
COPY_NODE_FIELD(alias);
COPY_SCALAR_FIELD(lateral);
COPY_LOCATION_FIELD(location);
return newnode;
}
/*
* _copyJsonTableColumn
*/
static JsonTableColumn *
_copyJsonTableColumn(const JsonTableColumn *from)
{
JsonTableColumn *newnode = makeNode(JsonTableColumn);
COPY_SCALAR_FIELD(coltype);
COPY_STRING_FIELD(name);
COPY_NODE_FIELD(typeName);
COPY_STRING_FIELD(pathspec);
COPY_STRING_FIELD(pathname);
COPY_NODE_FIELD(format);
COPY_SCALAR_FIELD(wrapper);
COPY_SCALAR_FIELD(omit_quotes);
COPY_NODE_FIELD(columns);
COPY_NODE_FIELD(on_empty);
COPY_NODE_FIELD(on_error);
COPY_LOCATION_FIELD(location);
return newnode;
}
/*
* _copyJsonTablePlan
*/
static JsonTablePlan *
_copyJsonTablePlan(const JsonTablePlan *from)
{
JsonTablePlan *newnode = makeNode(JsonTablePlan);
COPY_SCALAR_FIELD(plan_type);
COPY_SCALAR_FIELD(join_type);
COPY_NODE_FIELD(plan1);
COPY_NODE_FIELD(plan2);
COPY_STRING_FIELD(pathname);
COPY_LOCATION_FIELD(location);
return newnode;
}
/*
* _copyJsonTableParent
*/
static JsonTableParent *
_copyJsonTableParent(const JsonTableParent *from)
{
JsonTableParent *newnode = makeNode(JsonTableParent);
COPY_NODE_FIELD(path);
COPY_STRING_FIELD(name);
COPY_NODE_FIELD(child);
COPY_SCALAR_FIELD(outerJoin);
COPY_SCALAR_FIELD(colMin);
COPY_SCALAR_FIELD(colMax);
COPY_SCALAR_FIELD(errorOnError);
return newnode;
}
/*
* _copyJsonTableSibling
*/
static JsonTableSibling *
_copyJsonTableSibling(const JsonTableSibling *from)
{
JsonTableSibling *newnode = makeNode(JsonTableSibling);
COPY_NODE_FIELD(larg);
COPY_NODE_FIELD(rarg);
COPY_SCALAR_FIELD(cross);
return newnode;
}
/* ****************************************************************
* pathnodes.h copy functions
*
@@ -5885,90 +5403,6 @@ copyObjectImpl(const void *from)
case T_OnConflictExpr:
retval = _copyOnConflictExpr(from);
break;
case T_JsonFormat:
retval = _copyJsonFormat(from);
break;
case T_JsonReturning:
retval = _copyJsonReturning(from);
break;
case T_JsonValueExpr:
retval = _copyJsonValueExpr(from);
break;
case T_JsonParseExpr:
retval = _copyJsonParseExpr(from);
break;
case T_JsonScalarExpr:
retval = _copyJsonScalarExpr(from);
break;
case T_JsonSerializeExpr:
retval = _copyJsonSerializeExpr(from);
break;
case T_JsonKeyValue:
retval = _copyJsonKeyValue(from);
break;
case T_JsonConstructorExpr:
retval = _copyJsonConstructorExpr(from);
break;
case T_JsonObjectConstructor:
retval = _copyJsonObjectConstructor(from);
break;
case T_JsonAggConstructor:
retval = _copyJsonAggConstructor(from);
break;
case T_JsonObjectAgg:
retval = _copyJsonObjectAgg(from);
break;
case T_JsonOutput:
retval = _copyJsonOutput(from);
break;
case T_JsonArrayConstructor:
retval = _copyJsonArrayConstructor(from);
break;
case T_JsonArrayQueryConstructor:
retval = _copyJsonArrayQueryConstructor(from);
break;
case T_JsonArrayAgg:
retval = _copyJsonArrayAgg(from);
break;
case T_JsonIsPredicate:
retval = _copyJsonIsPredicate(from);
break;
case T_JsonFuncExpr:
retval = _copyJsonFuncExpr(from);
break;
case T_JsonExpr:
retval = _copyJsonExpr(from);
break;
case T_JsonCommon:
retval = _copyJsonCommon(from);
break;
case T_JsonBehavior:
retval = _copyJsonBehavior(from);
break;
case T_JsonArgument:
retval = _copyJsonArgument(from);
break;
case T_JsonCoercion:
retval = _copyJsonCoercion(from);
break;
case T_JsonItemCoercions:
retval = _copyJsonItemCoercions(from);
break;
case T_JsonTable:
retval = _copyJsonTable(from);
break;
case T_JsonTableColumn:
retval = _copyJsonTableColumn(from);
break;
case T_JsonTablePlan:
retval = _copyJsonTablePlan(from);
break;
case T_JsonTableParent:
retval = _copyJsonTableParent(from);
break;
case T_JsonTableSibling:
retval = _copyJsonTableSibling(from);
break;
/*
* RELATION NODES