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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: gregoire(dot)hubert(at)pragmafabrik(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #13506: jsonb || operator does not work
Date: 2015-07-20 17:44:58
Message-ID: 30902.1437414298@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2015-07-20 17:48:48 Re: [BUGS] object_classes array is broken, again
Previous Message Tom Lane 2015-07-20 16:59:41 Re: [HACKERS] object_classes array is broken, again