Re: BUG #13506: jsonb || operator does not work - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #13506: jsonb || operator does not work
Date
Msg-id 30902.1437414298@sss.pgh.pa.us
Whole thread Raw
In response to BUG #13506: jsonb || operator does not work  (gregoire.hubert@pragmafabrik.com)
Responses Re: BUG #13506: jsonb || operator does not work
List pgsql-bugs
gregoire.hubert@pragmafabrik.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

pgsql-bugs by date:

Previous
From: gregoire.hubert@pragmafabrik.com
Date:
Subject: BUG #13506: jsonb || operator does not work
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] object_classes array is broken, again