Re: Cache lookup error when using jsonb, json_build_object and a WITH clause - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Cache lookup error when using jsonb, json_build_object and a WITH clause
Date
Msg-id 17257.1399643277@sss.pgh.pa.us
Whole thread Raw
In response to Re: Cache lookup error when using jsonb, json_build_object and a WITH clause  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: Cache lookup error when using jsonb, json_build_object and a WITH clause  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Andres Freund <andres@2ndquadrant.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



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: postgresql.auto.conf read from wrong directory
Next
From: Fujii Masao
Date:
Subject: Re: New pg_lsn type doesn't have hash/btree opclasses