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

From David G. Johnston
Subject Re: Add jsonb_compact(...) for whitespace-free jsonb to text
Date
Msg-id CAKFQuwbf0DCz6Bb+Gjeh9KOXFJ2GCa_xT8H3mqUCuTWFbvAVwA@mail.gmail.com
Whole thread Raw
In response to Add jsonb_compact(...) for whitespace-free jsonb to text  (Sehrope Sarkuni <sehrope@jackdb.com>)
List pgsql-hackers
On Sun, Apr 24, 2016 at 3:02 PM, Sehrope Sarkuni <sehrope@jackdb.com> wrote:
It'd be nice to have a stable text representation of a jsonb value with minimal whitespace. The latter would also save a few bytes per record in text output formats, on the wire, and in backups (ex: COPY ... TO STDOUT).
Attached is a *very* work in progress patch that adds a jsonb_compact(jsonb)::text function. It generates a text representation without extra whitespace but does not yet try to enforce a stable order of the properties within a jsonb value.


This doesn't impact backups unless you do away with the function and change the output i/o function for the type.​  In that scenario the function is no longer necessary.

David J.
 

pgsql-hackers by date:

Previous
From: Mikael Kjellström
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Modify the isolation tester so that multiple sessions can wait.
Next
From: Tom Lane
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Modify the isolation tester so that multiple sessions can wait.