Re: dubious warning: FORMAT JSON has no effect for json and jsonb types

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: dubious warning: FORMAT JSON has no effect for json and jsonb types
Date: 2023-08-18 05:59:34
Message-ID: 954243a2-45d6-f1cf-6e2c-8db66b58ce4c@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 16.08.23 16:59, Merlin Moncure wrote:
> On Wed, Aug 16, 2023 at 8:55 AM Peter Eisentraut <peter(at)eisentraut(dot)org
> <mailto:peter(at)eisentraut(dot)org>> wrote:
>
> This warning comes from parse_expr.c transformJsonValueExpr() and is
> triggered for example by the following test case:
>
> SELECT JSON_OBJECT('foo': NULL::json FORMAT JSON);
> WARNING:  FORMAT JSON has no effect for json and jsonb types
>
> But I don't see anything in the SQL standard that would require this
> warning.  It seems pretty clear that FORMAT JSON in this case is
> implicit and otherwise without effect.
>
> Also, we don't have that warning in the output case (RETURNING json
> FORMAT JSON).
>
> Anyone remember why this is here?  Should we remove it?
>
>
> +1 for removing, on the basis that it is not suprising, and would
> pollute logs for most configurations.

done

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message torikoshia 2023-08-18 06:40:57 Re: pg_rewind WAL segments deletion pitfall
Previous Message Michael Paquier 2023-08-18 05:11:47 Re: Rethink the wait event names for postgres_fdw, dblink and etc