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

From David Fetter
Subject Re: Add jsonb_compact(...) for whitespace-free jsonb to text
Date
Msg-id 20160428175621.GA6362@fetter.org
Whole thread Raw
In response to Re: Add jsonb_compact(...) for whitespace-free jsonb to text  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
On Wed, Apr 27, 2016 at 05:05:18PM -0400, Stephen Frost wrote:
> * Merlin Moncure (mmoncure@gmail.com) wrote:
> > On Tue, Apr 26, 2016 at 11:49 AM, Stephen Frost <sfrost@snowman.net> wrote:
> > > As I mentioned to Sehrope on IRC, at least for my 2c, if you want a
> > > compact JSON format to reduce the amount of traffic over the wire or to
> > > do things with on the client side, we should probably come up with a
> > > binary format, rather than just hack out the whitespace.  It's not like
> > > representing numbers using ASCII characters is terribly efficient
> > > either.
> > 
> > -1
> > 
> > This will benefit pretty much nobody unless you are writing a hand
> > crafted C application that consumes and processes the data directly.
> 
> That's not accurate.  All that's needed is for the libraries which
> either wrap libpq or re-implement it to be updated to understand the
> format and then convert the data into whatever structure makes sense for
> the language (or library that the language includes for working with
> JSON data).
> 
> One of the unfortunate realities with JSON is that there isn't a
> terribly good binary representation, afaik.  As I understand it, BSON
> doesn't support all the JSON structures that we do; if it did, I'd
> suggest we provide a way to convert our structure into BSON.

How about MessagePack?
http://msgpack.org/index.html

Cheers,
David.
-- 
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate



pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Add jsonb_compact(...) for whitespace-free jsonb to text
Next
From: Greg Stark
Date:
Subject: Re: 9.6 and fsync=off