aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_target.c
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2022-03-03 13:15:13 -0500
committerAndrew Dunstan <andrew@dunslane.net>2022-03-30 16:30:37 -0400
commit606948b058dc16bce494270eea577011a602810e (patch)
treedad8b48083701f5560b6696b6ad770a3c6af84d3 /src/backend/parser/parse_target.c
parent8e053dc6dfbee4ae412e98ad73cfd4662d7453ac (diff)
downloadpostgresql-606948b058dc16bce494270eea577011a602810e.tar.gz
postgresql-606948b058dc16bce494270eea577011a602810e.zip
SQL JSON functions
This Patch introduces three SQL standard JSON functions: JSON() (incorrectly mentioned in my commit message for f4fb45d15c) JSON_SCALAR() JSON_SERIALIZE() JSON() produces json values from text, bytea, json or jsonb values, and has facilitites for handling duplicate keys. JSON_SCALAR() produces a json value from any scalar sql value, including json and jsonb. JSON_SERIALIZE() produces text or bytea from input which containis or represents json or jsonb; For the most part these functions don't add any significant new capabilities, but they will be of use to users wanting standard compliant JSON handling. Nikita Glukhov Reviewers have included (in no particular order) Andres Freund, Alexander Korotkov, Pavel Stehule, Andrew Alsup, Erik Rijkers, Zihong Yu, Himanshu Upadhyaya, Daniel Gustafsson, Justin Pryzby. Discussion: https://postgr.es/m/cd0bb935-0158-78a7-08b5-904886deac4b@postgrespro.ru
Diffstat (limited to 'src/backend/parser/parse_target.c')
-rw-r--r--src/backend/parser/parse_target.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/backend/parser/parse_target.c b/src/backend/parser/parse_target.c
index 62d5d7d4395..31c576cfec5 100644
--- a/src/backend/parser/parse_target.c
+++ b/src/backend/parser/parse_target.c
@@ -1958,6 +1958,15 @@ FigureColnameInternal(Node *node, char **name)
case T_XmlSerialize:
*name = "xmlserialize";
return 2;
+ case T_JsonParseExpr:
+ *name = "json";
+ return 2;
+ case T_JsonScalarExpr:
+ *name = "json_scalar";
+ return 2;
+ case T_JsonSerializeExpr:
+ *name = "json_serialize";
+ return 2;
case T_JsonObjectConstructor:
*name = "json_object";
return 2;