pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nikita Glukhov <n.gluhov@postgrespro.ru>
Cc: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: David Steele <david@pgmasters.net>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Aleksander Alekseev <a.alekseev@postgrespro.ru>
Cc: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Subject: Re: PATCH: recursive json_populate_record()
Date: Mon, 29 May 2017 19:31:45 -0400
Message-ID: <10871.1496100705@sss.pgh.pa.us> (raw)
In-Reply-To: <fbd1d566-bba0-a3de-d6d0-d3b1d7c24ff2@postgrespro.ru>
References: <687e19a7-14e2-d0f5-2bff-35d62bc5c05a@postgrespro.ru>
	<934.1485111512@sss.pgh.pa.us>
	<9e21a39c-c1d7-b9b5-44a0-c5345a5029f6@postgrespro.ru>
	<13020.1485377905@sss.pgh.pa.us>
	<295ad4a5-2923-1834-5140-35d0b9a5818c@postgrespro.ru>
	<16179.1485380983@sss.pgh.pa.us>
	<CAB7nPqSGyCxh9CqPXp5TTE+A0svyWvbO1sp3BT87VtDxtT4tLQ@mail.gmail.com>
	<9bf14a7c-0794-f90c-c012-8dd0335ab364@pgmasters.net>
	<bcb6edee-f124-d5f4-3314-09b5274bd328@pgmasters.net>
	<754780af-d905-9704-cf4d-b64e632b86a3@2ndQuadrant.com>
	<20170403211741.7ommm5dssfv3abo6@alap3.anarazel.de>
	<45c0aa55-1b62-c622-31fd-cb21e017d5cd@2ndQuadrant.com>
	<8fcd9e65-acb0-8221-ef23-01e5c2fe90e4@2ndQuadrant.com>
	<ad7bc08c-b5af-e4e7-cc61-0ea326f5aa42@2ndQuadrant.com>
	<fbd1d566-bba0-a3de-d6d0-d3b1d7c24ff2@postgrespro.ru>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Nikita Glukhov <n.gluhov@postgrespro.ru> writes:
> Attached two small fixes for the previous committed patch:

> 1. I've noticed a difference in behavior between json_populate_record()
> and  jsonb_populate_record() if we are trying to populate record from a
> non-JSON-object: json function throws an error but jsonb function returns
> a record with NULL fields. So I think it would be better to throw an error
> in jsonb case too, but I'm not sure.

Agreed on the error.  I reformatted the code a bit.

> 2. Also I've found a some kind of thinko in JsGetObjectSize() macro, but it
> seems that this obvious mistake can not lead to incorrect behavior.

Hm, I think it actually was wrong for the case of jsonb_cont == NULL,
wasn't it?  But maybe that case didn't arise for the sole call site.
Anyway, agreed.  Pushed both patches.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (27+ messages)  latest in thread

Message-ID: <10871.1496100705@sss.pgh.pa.us>
Permalink:  ../10871.1496100705@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10871.1496100705@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, n.gluhov@postgrespro.ru, andrew.dunstan@2ndquadrant.com, andres@anarazel.de, david@pgmasters.net, michael.paquier@gmail.com, a.alekseev@postgrespro.ru
  Subject: Re: PATCH: recursive json_populate_record()
  In-Reply-To: <10871.1496100705@sss.pgh.pa.us>

* 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