Re: pgsql: Add more SQL/JSON constructor functions

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Amit Langote <amitlan(at)postgresql(dot)org>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Add more SQL/JSON constructor functions
Date: 2024-05-27 13:26:58
Message-ID: 202405271326.5a5rprki64aw@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2024-05-27 14:06:30 Re: Fix calloc check if oom (PQcancelCreate)
Previous Message Daniel Gustafsson 2024-05-27 13:22:57 Re: Fix calloc check if oom (PQcancelCreate)