Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdcfc49c

Browse files
committed
Remove dubious warning message from SQL/JSON functions
There was a warning that FORMAT JSON has no effect on json/jsonbtypes, which is true, but it's not clear why we should issue a warningabout it. The SQL standard does not say anything about this, whichshould generally govern the behavior here. So remove it.Discussion:https://www.postgresql.org/message-id/flat/dfec2cae-d17e-c508-6d16-c2dba82db486%40eisentraut.org
1 parent6337e99 commitdcfc49c

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

‎src/backend/parser/parse_expr.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3240,12 +3240,7 @@ transformJsonValueExpr(ParseState *pstate, const char *constructName,
32403240
parser_errposition(pstate,ve->format->location));
32413241

32423242
if (exprtype==JSONOID||exprtype==JSONBOID)
3243-
{
32443243
format=JS_FORMAT_DEFAULT;/* do not format json[b] types */
3245-
ereport(WARNING,
3246-
errmsg("FORMAT JSON has no effect for json and jsonb types"),
3247-
parser_errposition(pstate,ve->format->location));
3248-
}
32493244
else
32503245
format=ve->format->format_type;
32513246
}

‎src/test/regress/expected/sqljson.out‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@ ERROR: JSON ENCODING clause is only allowed for bytea input type
8484
LINE 1: SELECT JSON_OBJECT('foo': NULL::int FORMAT JSON ENCODING UTF...
8585
^
8686
SELECT JSON_OBJECT('foo': NULL::json FORMAT JSON);
87-
WARNING: FORMAT JSON has no effect for json and jsonb types
88-
LINE 1: SELECT JSON_OBJECT('foo': NULL::json FORMAT JSON);
89-
^
9087
json_object
9188
----------------
9289
{"foo" : null}
@@ -97,9 +94,6 @@ ERROR: JSON ENCODING clause is only allowed for bytea input type
9794
LINE 1: SELECT JSON_OBJECT('foo': NULL::json FORMAT JSON ENCODING UT...
9895
^
9996
SELECT JSON_OBJECT('foo': NULL::jsonb FORMAT JSON);
100-
WARNING: FORMAT JSON has no effect for json and jsonb types
101-
LINE 1: SELECT JSON_OBJECT('foo': NULL::jsonb FORMAT JSON);
102-
^
10397
json_object
10498
---------------
10599
{"foo": null}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp