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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Cache lookup error when using jsonb, json_build_object and a WITH clause
Date: 2014-05-09 13:47:57
Message-ID: 17257.1399643277@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> Whoa. There's two wierd things here:
> a) "jsonb" has a typcategory 'C'. Marking a composite type. "json" has
> 'U'.

Yeah, that's flat out wrong. I changed it before seeing your message.

> b) datum_to_json() thinks it's a good idea to use typcategory to decide
> how a type is output. Isn't that pertty fundamentally flawed?

Indeed. I think the bit that uses TYPCATEGORY_NUMERIC as a hint to decide
whether the value can be left unquoted (assuming it looks like a number)
might be all right, but the rest of this seems pretty bogus.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2014-05-09 13:49:45 Re: New pg_lsn type doesn't have hash/btree opclasses
Previous Message Fujii Masao 2014-05-09 13:31:27 Re: postgresql.auto.conf read from wrong directory