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

Commit881cd9e

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 parent249d743 commit881cd9e

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
@@ -3257,12 +3257,7 @@ transformJsonValueExpr(ParseState *pstate, const char *constructName,
32573257
parser_errposition(pstate,ve->format->location));
32583258

32593259
if (exprtype==JSONOID||exprtype==JSONBOID)
3260-
{
32613260
format=JS_FORMAT_DEFAULT;/* do not format json[b] types */
3262-
ereport(WARNING,
3263-
errmsg("FORMAT JSON has no effect for json and jsonb types"),
3264-
parser_errposition(pstate,ve->format->location));
3265-
}
32663261
else
32673262
format=ve->format->format_type;
32683263
}

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,6 @@ ERROR: JSON ENCODING clause is only allowed for bytea input type
374374
LINE 1: SELECT JSON_OBJECT('foo': NULL::int FORMAT JSON ENCODING UTF...
375375
^
376376
SELECT JSON_OBJECT('foo': NULL::json FORMAT JSON);
377-
WARNING: FORMAT JSON has no effect for json and jsonb types
378-
LINE 1: SELECT JSON_OBJECT('foo': NULL::json FORMAT JSON);
379-
^
380377
json_object
381378
----------------
382379
{"foo" : null}
@@ -387,9 +384,6 @@ ERROR: JSON ENCODING clause is only allowed for bytea input type
387384
LINE 1: SELECT JSON_OBJECT('foo': NULL::json FORMAT JSON ENCODING UT...
388385
^
389386
SELECT JSON_OBJECT('foo': NULL::jsonb FORMAT JSON);
390-
WARNING: FORMAT JSON has no effect for json and jsonb types
391-
LINE 1: SELECT JSON_OBJECT('foo': NULL::jsonb FORMAT JSON);
392-
^
393387
json_object
394388
---------------
395389
{"foo": null}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp