Re: Add jsonb_compact(...) for whitespace-free jsonb to text - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Add jsonb_compact(...) for whitespace-free jsonb to text
Date
Msg-id 571D6FE6.5080604@dunslane.net
Whole thread Raw
In response to Add jsonb_compact(...) for whitespace-free jsonb to text  (Sehrope Sarkuni <sehrope@jackdb.com>)
Responses Re: Add jsonb_compact(...) for whitespace-free jsonb to text  (Stephen Frost <sfrost@snowman.net>)
Re: Add jsonb_compact(...) for whitespace-free jsonb to text  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-hackers

On 04/24/2016 06:02 PM, Sehrope Sarkuni wrote:
>
> AFAIK, there's also no guarantee on the specific order of the 
> resulting properties in the text representation either. I would 
> suppose it's fixed for a given jsonb value within a database major 
> version but across major versions it could change (if the underlying 
> representation changes).


The order is fixed and very unlikely to change, as it was chosen quite 
deliberately to help ensure efficient processing. Any change in on-disk 
representation of data types is something we work very hard to avoid, as 
it makes it impossible to run pg_upgrade.

It's true that the storage order of keys is not terribly intuitive.

Note that the json type, unlike jsonb, preserves exactly the white space 
and key order of its input. In fact, the input is exactly what it stores.

cheers

andrew




pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Rename max_parallel_degree?
Next
From: Stephen Frost
Date:
Subject: Re: Add jsonb_compact(...) for whitespace-free jsonb to text