Re: Add jsonb_compact(...) for whitespace-free jsonb to text

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: Add jsonb_compact(...) for whitespace-free jsonb to text
Дата
Msg-id 20160426164909.GC10850@tamriel.snowman.net
обсуждение исходный текст
Ответ на Re: Add jsonb_compact(...) for whitespace-free jsonb to text  (Ryan Pedela <rpedela@datalanche.com>)
Ответы Re: Add jsonb_compact(...) for whitespace-free jsonb to text  (Dave Cramer <pg@fastcrypt.com>)
Re: Add jsonb_compact(...) for whitespace-free jsonb to text  (Merlin Moncure <mmoncure@gmail.com>)
Re: Add jsonb_compact(...) for whitespace-free jsonb to text  (Ryan Pedela <rpedela@datalanche.com>)
Список pgsql-hackers
* Ryan Pedela (rpedela@datalanche.com) wrote:
> On Sun, Apr 24, 2016 at 4:02 PM, Sehrope Sarkuni <sehrope@jackdb.com> wrote:
> > The default text representation of jsonb adds whitespace in between
> > key/value pairs (after the colon ":") and after successive properties
> > (after the comma ","):

[...]

> > 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).
>
> +1
>
> I cannot comment on the patch itself, but I welcome jsonb_compact() or some
> way to get JSON with no inserted whitespace.

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.

Compression might be another option, though that's certainly less
flexible and only (easily) used in combination with SSL, today.

Thanks!

Stephen

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Ryan Pedela
Дата:
Сообщение: Re: Add jsonb_compact(...) for whitespace-free jsonb to text
Следующее
От: Teodor Sigaev
Дата:
Сообщение: Re: GIN data corruption bug(s) in 9.6devel