Seamus Abshere
2014-09-23 15:47:39 UTC
hi all,
json and string cannot be matched"?
Thanks,
Seamus
$ 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);
^
foobar=# select coalesce('{}'::json->'a', 'b');
ERROR: invalid input syntax for type json
LINE 1: select coalesce('{}'::json->'a', 'b');
^
DETAIL: Token "b" is invalid.
CONTEXT: JSON data, line 1: b
That seems like the wrong error - shouldn't it be the equiv of "[...]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);
^
foobar=# select coalesce('{}'::json->'a', 'b');
ERROR: invalid input syntax for type json
LINE 1: select coalesce('{}'::json->'a', 'b');
^
DETAIL: Token "b" is invalid.
CONTEXT: JSON data, line 1: b
json and string cannot be matched"?
Thanks,
Seamus
--
Seamus Abshere, SCEA
https://github.com/seamusabshere
--
Sent via pgsql-general mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Seamus Abshere, SCEA
https://github.com/seamusabshere
--
Sent via pgsql-general mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general