Re: BUG #13972: jsonb_to_record cant map camelcase keys

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: zn(at)dbml(dot)dk
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13972: jsonb_to_record cant map camelcase keys
Date: 2016-02-18 16:52:03
Message-ID: CAKFQuwZdSZH-moMo-++nSZxcOBcx08h68zoHKSZt6tAULkj0WQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Feb 18, 2016 at 6:12 AM, <zn(at)dbml(dot)dk> wrote:

> The following bug has been logged on the website:
>
> Bug reference: 13972
> Logged by: Jacob Zneider
> Email address: zn(at)dbml(dot)dk
> PostgreSQL version: 9.4.5
> Operating system: OS x 10.11.3
> Description:
>
> 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.
>
> select * from json_to_record('{"aa":1,"bb":[1,2,3],"c":"bar"}') as x(aA
> int,
> bB text, c text)
>
> All columns are mapped.
>
> select * from json_to_record('{"aa":1,"bb":[1,2,3],"c":"bar"}') as x(aa
> int,
> bb text, c text)
>
>

Working as intended.

​Unquoted identifiers in SQL are folded to lower case. There is no
difference between the "as x(...)" in your example. They all result in
(aa, bb, c)​. The fact that json_to_record attempts to match in a
case-sensitive manner is intentional.

David J.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2016-02-18 17:01:09 Re: BUG #13973: Constants resolved in then/else clauses
Previous Message Alvaro Herrera 2016-02-18 16:50:52 Re: BUG #13973: Constants resolved in then/else clauses