Re: BUG #17099: Problem with EXECUTE and JSON

Поиск
Список
Период
Сортировка
От Sergei Kornilov
Тема Re: BUG #17099: Problem with EXECUTE and JSON
Дата
Msg-id 324211626076936@mail.yandex.ru
обсуждение исходный текст
Ответ на BUG #17099: Problem with EXECUTE and JSON  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
Hello

> Why i get an error if sends text but not error if send digits ?

Because text '123' is valid JSON. text 'text' - not valid. text '"text"' is valid JSON string.

Your example could be reduced to

> select cast(json_build_object('name','name')->>'name' as jsonb);

That means

> select cast('name'::text as jsonb);

Probably you wanted ->'name', not ->>'name'. JSON(b) operator -> will return json/jsonb type.

regards, Sergei



В списке pgsql-bugs по дате отправления:

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #17100: undefined reference to `pg_qsort and pq_xxx
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #17101: Inconsistent behaviour when querying with anonymous composite types