Content-Length: 717581 | pFad | http://github.com/postgrespro/postgres/commit/d5a568a5ad026f17a1b45ffda0a142f407eb95bc

8D Rename JSON_TRANSFORM to JSON_MODIFY · postgrespro/postgres@d5a568a · GitHub
Skip to content

Commit d5a568a

Browse files
author
Nikita Glukhov
committed
Rename JSON_TRANSFORM to JSON_MODIFY
1 parent c0fc98b commit d5a568a

File tree

10 files changed

+181
-181
lines changed

10 files changed

+181
-181
lines changed

src/backend/executor/execExprInterp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5231,7 +5231,7 @@ ExecEvalJsonTransform(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
52315231
op->d.jsontransform.ops[i].expr.isnull)
52325232
ereport(ERROR,
52335233
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
5234-
errmsg("JSON_TRANSFORM called with NULL input")));
5234+
errmsg("JSON_MODIFY called with NULL input")));
52355235

52365236
path = DatumGetJsonPathP(op->d.jsontransform.ops[i].pathspec.value);
52375237
res = JsonPathTransform(res, path,

src/backend/parser/gram.y

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -823,8 +823,8 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
823823
INNER_P INOUT INPUT_P INSENSITIVE INSERT INSTEAD INT_P INTEGER
824824
INTERSECT INTERVAL INTO INVOKER IS ISNULL ISOLATION
825825

826-
JOIN JSON JSON_ARRAY JSON_ARRAYAGG JSON_EXISTS JSON_OBJECT JSON_OBJECTAGG
827-
JSON_QUERY JSON_SCALAR JSON_SERIALIZE JSON_TABLE JSON_TRANSFORM JSON_VALUE
826+
JOIN JSON JSON_ARRAY JSON_ARRAYAGG JSON_EXISTS JSON_MODIFY JSON_OBJECT
827+
JSON_OBJECTAGG JSON_QUERY JSON_SCALAR JSON_SERIALIZE JSON_TABLE JSON_VALUE
828828

829829
KEY KEYS KEEP
830830

@@ -17294,7 +17294,7 @@ json_array_aggregate_order_by_clause_opt:
1729417294
;
1729517295

1729617296
json_transform_expr:
17297-
JSON_TRANSFORM '('
17297+
JSON_MODIFY '('
1729817298
json_context_item ','
1729917299
json_transform_op_list
1730017300
json_output_clause_opt
@@ -18273,13 +18273,13 @@ col_name_keyword:
1827318273
| JSON_ARRAY
1827418274
| JSON_ARRAYAGG
1827518275
| JSON_EXISTS
18276+
| JSON_MODIFY
1827618277
| JSON_OBJECT
1827718278
| JSON_OBJECTAGG
1827818279
| JSON_QUERY
1827918280
| JSON_SCALAR
1828018281
| JSON_SERIALIZE
1828118282
| JSON_TABLE
18282-
| JSON_TRANSFORM
1828318283
| JSON_VALUE
1828418284
| LEAST
1828518285
| NATIONAL
@@ -18644,13 +18644,13 @@ bare_label_keyword:
1864418644
| JSON_ARRAY
1864518645
| JSON_ARRAYAGG
1864618646
| JSON_EXISTS
18647+
| JSON_MODIFY
1864718648
| JSON_OBJECT
1864818649
| JSON_OBJECTAGG
1864918650
| JSON_QUERY
1865018651
| JSON_SCALAR
1865118652
| JSON_SERIALIZE
1865218653
| JSON_TABLE
18653-
| JSON_TRANSFORM
1865418654
| JSON_VALUE
1865518655
| KEEP
1865618656
| KEY

src/backend/parser/parse_expr.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4200,7 +4200,7 @@ coerceJsonExpr(ParseState *pstate, Node *expr, const JsonReturning *returning)
42004200
}
42014201

42024202
/*
4203-
* Transform a JSON output clause of JSON_VALUE, JSON_QUERY and JSON_TRANSFORM.
4203+
* Transform a JSON output clause of JSON_VALUE, JSON_QUERY and JSON_MODIFY.
42044204
*/
42054205
static JsonReturning *
42064206
transformJsonExprOutput(ParseState *pstate, Node *formatted_expr,
@@ -4697,19 +4697,19 @@ transformJsonTransformOp(ParseState *pstate, JsonTransformOp *jto,
46974697
if (!((1 << op->on_null) & on_null_mask))
46984698
ereport(ERROR,
46994699
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
4700-
errmsg("invalid ON NULL behavior in JSON_TRANSFORM()"),
4700+
errmsg("invalid ON NULL behavior in JSON_MODIFY()"),
47014701
parser_errposition(pstate, exprLocation((Node *) jto))));
47024702

47034703
if (!((1 << op->on_missing) & on_missing_mask))
47044704
ereport(ERROR,
47054705
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
4706-
errmsg("invalid ON MISSING behavior in JSON_TRANSFORM()"),
4706+
errmsg("invalid ON MISSING behavior in JSON_MODIFY()"),
47074707
parser_errposition(pstate, exprLocation((Node *) jto))));
47084708

47094709
if (!((1 << op->on_existing) & on_existing_mask))
47104710
ereport(ERROR,
47114711
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
4712-
errmsg("invalid ON EXISTING behavior in JSON_TRANSFORM()"),
4712+
errmsg("invalid ON EXISTING behavior in JSON_MODIFY()"),
47134713
parser_errposition(pstate, exprLocation((Node *) jto))));
47144714

47154715
op->pathspec =
@@ -4738,7 +4738,7 @@ transformJsonTransformOp(ParseState *pstate, JsonTransformOp *jto,
47384738
}
47394739

47404740
/*
4741-
* Transform a JSON_TRANSFORM() expression.
4741+
* Transform a JSON_MODIFY() expression.
47424742
*/
47434743
static Node *
47444744
transformJsonTransform(ParseState *pstate, JsonTransform *jst)
@@ -4760,7 +4760,7 @@ transformJsonTransform(ParseState *pstate, JsonTransform *jst)
47604760
if (expr_typid != JSONBOID)
47614761
ereport(ERROR,
47624762
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
4763-
errmsg("%s() is not yet implemented for the json type", "JSON_TRANSFORM"),
4763+
errmsg("%s() is not yet implemented for the json type", "JSON_MODIFY"),
47644764
errhint("Try casting the argument to jsonb"),
47654765
parser_errposition(pstate, jst->location)));
47664766

src/backend/utils/adt/jsonpath_exec.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ executeMutateAction(JsonPathExecContext *cxt, JsonbMutator *mutator,
852852
if (!JsonbMutatorIsArray(mutator))
853853
ereport(ERROR,
854854
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), /* XXX */
855-
errmsg("argument of %s APPEND is not an array", "JSON_TRANSFORM()")));
855+
errmsg("argument of %s APPEND is not an array", "JSON_MODIFY()")));
856856

857857
if (!cxt->update.value && cxt->update.onNull == JSTB_IGNORE)
858858
return NULL;
@@ -875,7 +875,7 @@ executeMutateAction(JsonPathExecContext *cxt, JsonbMutator *mutator,
875875
if (cxt->update.onExisting == JSTB_ERROR)
876876
ereport(ERROR,
877877
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), /* XXX */
878-
errmsg("existing value in %s", "JSON_TRANSFORM()")));
878+
errmsg("existing value in %s", "JSON_MODIFY()")));
879879

880880
if (cxt->update.onExisting == JSTB_IGNORE)
881881
return NULL;
@@ -892,14 +892,14 @@ executeMutateAction(JsonPathExecContext *cxt, JsonbMutator *mutator,
892892
ereport(ERROR,
893893
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), /* XXX */
894894
errmsg("invalid path in RENAME operation of %s",
895-
"JSON_TRANSFORM()")));
895+
"JSON_MODIFY()")));
896896

897897
if (!cxt->update.value ||
898898
cxt->update.value->type != jbvString)
899899
ereport(ERROR,
900900
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), /* XXX */
901901
errmsg("invalid key name value in RENAME operation of %s",
902-
"JSON_TRANSFORM()")));
902+
"JSON_MODIFY()")));
903903

904904
JsonbMutatorRemoveCurrent(mutator);
905905
JsonbObjectMutatorInsert((JsonObjectMutator *) mutator,
@@ -917,7 +917,7 @@ executeMutateAction(JsonPathExecContext *cxt, JsonbMutator *mutator,
917917
if (cxt->update.onMissing == JSTB_ERROR)
918918
ereport(ERROR,
919919
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), /* XXX */
920-
errmsg("missing value in %s", "JSON_TRANSFORM()")));
920+
errmsg("missing value in %s", "JSON_MODIFY()")));
921921

922922
/* TODO create path ??? */
923923
if (cxt->update.onMissing == JSTB_CREATE)
@@ -1291,7 +1291,7 @@ executeJsonPathUpdate(JsonPath *path, void *vars, JsonPathVarCallback getVar,
12911291
if (cxt.update.missing && onMissing == JSTB_ERROR)
12921292
ereport(ERROR,
12931293
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), /* XXX */
1294-
errmsg("missing value in %s", "JSON_TRANSFORM()")));
1294+
errmsg("missing value in %s", "JSON_MODIFY()")));
12951295

12961296
return resjbv ? resjbv : copyJsonbValue(&jbv_root);
12971297
}

src/backend/utils/adt/ruleutils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9878,7 +9878,7 @@ get_rule_expr(Node *node, deparse_context *context,
98789878
JsonTransformExpr *jtexpr = (JsonTransformExpr *) node;
98799879
ListCell *lc;
98809880

9881-
appendStringInfoString(buf, "JSON_TRANSFORM(");
9881+
appendStringInfoString(buf, "JSON_MODIFY(");
98829882
get_rule_expr(jtexpr->formatted_expr, context, showimplicit);
98839883

98849884
foreach(lc, jtexpr->ops)

src/include/nodes/parsenodes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,7 +1895,7 @@ typedef struct JsonArrayAgg
18951895

18961896
/*
18971897
* JsonTransform -
1898-
* untransformed representation of JSON_TRANSFORM()
1898+
* untransformed representation of JSON_MODIFY()
18991899
*/
19001900
typedef struct JsonTransform
19011901
{
@@ -1909,7 +1909,7 @@ typedef struct JsonTransform
19091909

19101910
/*
19111911
* JsonTransformOp -
1912-
* untransformed representation of JSON_TRANSFORM() operations
1912+
* untransformed representation of JSON_MODIFY() operations
19131913
*/
19141914
typedef struct JsonTransformOp
19151915
{

src/include/nodes/primnodes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1655,7 +1655,7 @@ typedef enum JsonTransformBehavior
16551655
} JsonTransformBehavior;
16561656

16571657
/*
1658-
* Transformed JSON_TRANSFORM() expression.
1658+
* Transformed JSON_MODIFY() expression.
16591659
*/
16601660
typedef struct JsonTransformExpr
16611661
{

src/include/parser/kwlist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,13 @@ PG_KEYWORD("json", JSON, COL_NAME_KEYWORD, BARE_LABEL)
239239
PG_KEYWORD("json_array", JSON_ARRAY, COL_NAME_KEYWORD, BARE_LABEL)
240240
PG_KEYWORD("json_arrayagg", JSON_ARRAYAGG, COL_NAME_KEYWORD, BARE_LABEL)
241241
PG_KEYWORD("json_exists", JSON_EXISTS, COL_NAME_KEYWORD, BARE_LABEL)
242+
PG_KEYWORD("json_modify", JSON_MODIFY, COL_NAME_KEYWORD, BARE_LABEL)
242243
PG_KEYWORD("json_object", JSON_OBJECT, COL_NAME_KEYWORD, BARE_LABEL)
243244
PG_KEYWORD("json_objectagg", JSON_OBJECTAGG, COL_NAME_KEYWORD, BARE_LABEL)
244245
PG_KEYWORD("json_query", JSON_QUERY, COL_NAME_KEYWORD, BARE_LABEL)
245246
PG_KEYWORD("json_scalar", JSON_SCALAR, COL_NAME_KEYWORD, BARE_LABEL)
246247
PG_KEYWORD("json_serialize", JSON_SERIALIZE, COL_NAME_KEYWORD, BARE_LABEL)
247248
PG_KEYWORD("json_table", JSON_TABLE, COL_NAME_KEYWORD, BARE_LABEL)
248-
PG_KEYWORD("json_transform", JSON_TRANSFORM, COL_NAME_KEYWORD, BARE_LABEL)
249249
PG_KEYWORD("json_value", JSON_VALUE, COL_NAME_KEYWORD, BARE_LABEL)
250250
PG_KEYWORD("keep", KEEP, UNRESERVED_KEYWORD, BARE_LABEL)
251251
PG_KEYWORD("key", KEY, UNRESERVED_KEYWORD, BARE_LABEL)

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/d5a568a5ad026f17a1b45ffda0a142f407eb95bc

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy