pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: dubious warning: FORMAT JSON has no effect for json and jsonb types
Date: Wed, 16 Aug 2023 15:54:57 +0200
Message-ID: <dfec2cae-d17e-c508-6d16-c2dba82db486@eisentraut.org> (raw)

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?





view thread (4+ messages)  latest in thread

Message-ID: <dfec2cae-d17e-c508-6d16-c2dba82db486@eisentraut.org>
Permalink:  ../dfec2cae-d17e-c508-6d16-c2dba82db486@eisentraut.org/
Also on:    postgresql.org/message-id/dfec2cae-d17e-c508-6d16-c2dba82db486@eisentraut.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: peter@eisentraut.org
  Subject: Re: dubious warning: FORMAT JSON has no effect for json and jsonb types
  In-Reply-To: <dfec2cae-d17e-c508-6d16-c2dba82db486@eisentraut.org>
  References: <dfec2cae-d17e-c508-6d16-c2dba82db486@eisentraut.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox