Re: [GENERAL] Unexpected syntax error when using JSON -> in 9.3.5

2014-09-23 Thread Tom Lane
Seamus Abshere writes: >> foobar=# select coalesce('{}'::json->'a', 1); >> ERROR: COALESCE types json and integer cannot be matched Right ... > but check it out when I use a string instead of an integer: >> foobar=# select coalesce('{}'::json->'a', 'b'); >> ERROR: invalid input syntax for typ

Re: [GENERAL] Unexpected syntax error when using JSON -> in 9.3.5

2014-09-23 Thread David G Johnston
seamusabshere wrote > hi all, > > This part looks correct and expected: > >> $ psql foobar >> psql (9.3.5) >> Type "help" for help. >> >> foobar=# select coalesce('{}'::json->'a', 1); >> ERROR: COALESCE types json and integer cannot be matched >> LINE 1: select coalesce('{}'::json->'a', 1); >>