From: Tom Lane <tgl@sss.pgh.pa.us>
To: zn@dbml.dk
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #13972: jsonb_to_record cant map camelcase keys
Date: Thu, 18 Feb 2016 12:03:23 -0500
Message-ID: <30509.1455815003@sss.pgh.pa.us> (raw)
In-Reply-To: <20160218131207.2660.88690@wrigleys.postgresql.org>
References: <20160218131207.2660.88690@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
zn@dbml.dk writes:
> Try the following:
> select * from json_to_record('{"aA":1,"bB":[1,2,3],"c":"bar"}') as x(aA int,
> bB text, c text)
> first two columns will be empty.
You need to do it like this:
select * from json_to_record('{"aA":1,"bB":[1,2,3],"c":"bar"}') as x("aA" int,
"bB" text, c text);
aA | bB | c
----+---------+-----
1 | [1,2,3] | bar
(1 row)
Without the quotes, the SQL names aA etc are case-folded to aa etc.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, zn@dbml.dk
Subject: Re: BUG #13972: jsonb_to_record cant map camelcase keys
In-Reply-To: <30509.1455815003@sss.pgh.pa.us>
References: <20160218131207.2660.88690@wrigleys.postgresql.org> <30509.1455815003@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