From: Andrew Dunstan <andrew@dunslane.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: Re: pgsql: Fix json_to_record() bug with nested objects.
Date: Thu, 3 Mar 2016 08:06:47 -0500
Message-ID: <56D836E7.4010007@dunslane.net> (raw)
In-Reply-To: <E1abKvf-0007oT-JW@gemulon.postgresql.org>
References: <E1abKvf-0007oT-JW@gemulon.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
On 03/02/2016 11:31 PM, Tom Lane wrote:
> I added a regression test case based on his example, plus parallel tests
> for json_to_recordset, jsonb_to_record, jsonb_to_recordset. The latter
> three do not exhibit the same bug (which suggests that we may be missing
> some opportunities to share code...)
Not really. The jsonb variants don't do any re-parsing at all, so
lex_level simply doesn't come into play, and for json_to_recordset we
want things from lex_level 2, not 1, as the json is supposed to be an
array of objects instead of just an object.
That's not to say that the code can't be improved - It very probably can.
cheers
andrew
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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-committers@postgresql.org
Cc: andrew@dunslane.net, tgl@sss.pgh.pa.us
Subject: Re: pgsql: Fix json_to_record() bug with nested objects.
In-Reply-To: <56D836E7.4010007@dunslane.net>
References: <E1abKvf-0007oT-JW@gemulon.postgresql.org> <56D836E7.4010007@dunslane.net>
* 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