Re: Cache lookup error when using jsonb, json_build_object and a WITH clause
В списке pgsql-hackers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Cache lookup error when using jsonb, json_build_object and a WITH clause |
| Дата | |
| Msg-id | 8422.1399640953@sss.pgh.pa.us обсуждение |
| Ответ на | Cache lookup error when using jsonb, json_build_object and a WITH clause (Michael Paquier <michael.paquier@gmail.com>) |
| Список | pgsql-hackers |
Michael Paquier <michael.paquier@gmail.com> writes:
> I found the following error when playing with jsonb and json_build_object:
> =# with jsonb_data as (select * from jsonb_each('{"aa" :
> "po"}'::jsonb)) select json_build_object(key,value) from jsonb_data;
> ERROR: XX000: cache lookup failed for type 2147483650
> LOCATION: lookup_type_cache, typcache.c:193
The immediate problem seems to be that add_json() did not get taught
that jsonb is of TYPCATEGORY_JSON; somebody missed updating that copy
of logic that's been copied and pasted several times too many, IMNSHO.
However, now that I look at this code, it seems like it's got more
problems than that:
* it will be fooled utterly by domains over types it's interested in.
* there is nothing stopping somebody from making user-defined types
with category 'j' or 'c', which will confuse it even more.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера