Re: BUG #13506: jsonb || operator does not work

From: grégoire Hubert <gregoire(dot)hubert(at)pragmafabrik(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #13506: jsonb || operator does not work
Date: 2015-07-21 09:06:11
Message-ID: CAKY574G1OV_yHPrg+JZrmZ=ab9_8p5S-7KtkCNmRr+b1Nx0wig@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Jul 20, 2015 at 7:44 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> gregoire(dot)hubert(at)pragmafabrik(dot)com writes:
>> select val->'a'||val->'c' from (values ($j${"a": {"b": 2}, "c": {"d":
>> 3}}$j$::jsonb)) a (val);
>
> You're making unwarranted assumptions about the precedence of those
> operators.
>
> (val->'a')||(val->'c') does what you expect. Working out what the
> expression does as-written is left as an exercise for the reader.

Ok, I got it: select (val->'a')||(val->'c') from…

Thank you for taking the time to reply.

Regards,
--
Grégoire HUBERT
Tel: 06.60.15.49.80
PragmaFabrik
http://www.pragmafabrik.com

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2015-07-21 09:10:40 Re: [HACKERS] Grouping Sets: Fix unrecognized node type bug
Previous Message Heikki Linnakangas 2015-07-21 08:45:31 Re: BUG #13442: ISBN doesn't always roundtrip with text