Re: Wanted: jsonb on-disk representation documentation - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Wanted: jsonb on-disk representation documentation
Date
Msg-id 2918.1399490857@sss.pgh.pa.us
Whole thread Raw
In response to Re: Wanted: jsonb on-disk representation documentation  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Wanted: jsonb on-disk representation documentation  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
And while I'm looking at it ...

The jsonb_ops storage format for values is inherently lossy, because it
cannot distinguish the string values "n", "t", "f" from JSON null or
boolean true, false respectively; nor does it know the difference between
a number and a string containing digits.  This appears to not quite be a
bug because the consistent functions force recheck for all queries that
care about values (as opposed to keys).  But if it's documented anywhere
I don't see where.  And in any case, is it a good idea?  We could fairly
easily change things so that these cases are guaranteed distinguishable.
We're using an entire byte to convey one bit of information (key or
value); I'm inclined to redefine the flag byte so that it tells not just
that but which JSON datatype is involved.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Wanted: jsonb on-disk representation documentation
Next
From: Robert Haas
Date:
Subject: Re: proposal: Set effective_cache_size to greater of .conf value, shared_buffers