mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Simplify productions for FORMAT JSON [ ENCODING name ]
This removes the production json_encoding_clause_opt, instead merging it into json_format_clause. Also remove the auxiliary makeJsonEncoding() function. Reviewed-by: Amit Langote <amitlangote09@gmail.com> Discussion: https://postgr.es/m/202312071841.u2gueb5dsrbk%40alvherre.pgsql
This commit is contained in:
@ -857,27 +857,6 @@ makeJsonValueExpr(Expr *raw_expr, Expr *formatted_expr,
|
||||
return jve;
|
||||
}
|
||||
|
||||
/*
|
||||
* makeJsonEncoding -
|
||||
* converts JSON encoding name to enum JsonEncoding
|
||||
*/
|
||||
JsonEncoding
|
||||
makeJsonEncoding(char *name)
|
||||
{
|
||||
if (!pg_strcasecmp(name, "utf8"))
|
||||
return JS_ENC_UTF8;
|
||||
if (!pg_strcasecmp(name, "utf16"))
|
||||
return JS_ENC_UTF16;
|
||||
if (!pg_strcasecmp(name, "utf32"))
|
||||
return JS_ENC_UTF32;
|
||||
|
||||
ereport(ERROR,
|
||||
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("unrecognized JSON encoding: %s", name));
|
||||
|
||||
return JS_ENC_DEFAULT;
|
||||
}
|
||||
|
||||
/*
|
||||
* makeJsonKeyValue -
|
||||
* creates a JsonKeyValue node
|
||||
|
Reference in New Issue
Block a user