Cache lookup error when using jsonb, json_build_object and a WITH clause

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Cache lookup error when using jsonb, json_build_object and a WITH clause
Date: 2014-05-09 12:40:07
Message-ID: CAB7nPqQQMSM-JVuNKZX66R1NK9JyxD4AxG48Cr-pwOmHiegp2A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

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

I would have expected the result to be the same as in the case of json:
=# with json_data as (select * from json_each('{"aa" : "po"}'::json))
select json_build_object(key,value) from json_data;
json_build_object
-------------------
{"aa" : "po"}
(1 row)

Regards,
--
Michael

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2014-05-09 13:01:07 Re: New pg_lsn type doesn't have hash/btree opclasses
Previous Message Tom Lane 2014-05-09 11:04:17 Re: default opclass for jsonb (was Re: Call for GIST/GIN/SP-GIST opclass documentation)