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