pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Amit Langote <amitlan@postgresql.org>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: pgsql: Add more SQL/JSON constructor functions
Date: Mon, 27 May 2024 15:26:58 +0200
Message-ID: <202405271326.5a5rprki64aw@alvherre.pgsql> (raw)
In-Reply-To: <202405271313.qkl63gffldmx@alvherre.pgsql>

On 2024-May-27, Alvaro Herrera wrote:

> > JSON_SERIALIZE()

I just noticed this behavior, which looks like a bug to me:

select json_serialize('{"a":1, "a":2}' returning varchar(5));
 json_serialize 
────────────────
 {"a":

I think this function should throw an error if the destination type
doesn't have room for the output json.  Otherwise, what good is the
serialization function?

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/





view thread (47+ messages)  latest in thread

Message-ID: <202405271326.5a5rprki64aw@alvherre.pgsql>
Permalink:  ../202405271326.5a5rprki64aw@alvherre.pgsql/
Also on:    postgresql.org/message-id/202405271326.5a5rprki64aw@alvherre.pgsql

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, amitlan@postgresql.org, pgsql-hackers@lists.postgresql.org
  Subject: Re: pgsql: Add more SQL/JSON constructor functions
  In-Reply-To: <202405271326.5a5rprki64aw@alvherre.pgsql>

* 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