Re: BUG #13972: jsonb_to_record cant map camelcase keys

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #13972: jsonb_to_record cant map camelcase keys
Дата
Msg-id 30509.1455815003@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #13972: jsonb_to_record cant map camelcase keys  (zn@dbml.dk)
Список pgsql-bugs
zn@dbml.dk writes:
> Try the following:

> select * from json_to_record('{"aA":1,"bB":[1,2,3],"c":"bar"}') as x(aA int,
> bB text, c text)

> first two columns will be empty.

You need to do it like this:

select * from json_to_record('{"aA":1,"bB":[1,2,3],"c":"bar"}') as x("aA" int,
"bB" text, c text);
 aA |   bB    |  c
----+---------+-----
  1 | [1,2,3] | bar
(1 row)

Without the quotes, the SQL names aA etc are case-folded to aa etc.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #13973: Constants resolved in then/else clauses
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: BUG #13971: SysV shm is used regardless of config