Re: JSON Patch for PostgreSQL - BSON Support?

From: Christopher Browne <cbbrowne(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Charles Pritchard <chuck(at)jumis(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: JSON Patch for PostgreSQL - BSON Support?
Date: 2010-08-16 15:40:28
Message-ID: AANLkTimUxaPSoSL0k5t7hk2NDmxG4t17vYQ3PPLMRzYz@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 16, 2010 at 11:21 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Mon, Aug 16, 2010 at 11:05 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>>> If BSON is simply in effect an efficient encoding of JSON, then it's not
>>> clear to me that we would want another type at all. Rather, we might
>>> want to consider storing the data in this supposedly more efficient
>>> format, and maybe also some conversion routines.
>>
>> Hmm, that's an interesting plan ...
>
> It is interesting, but I'm not sure that it will actually work out
> well in practice.  If what we want to do is compress JSON, TOAST will
> do that for us without any additional code, and probably a lot more
> efficiently.  Of course, until someone tests it, we're just
> speculating wildly.

Yep, that was exactly what struck me. TOAST is quite likely to be a
good answer for this.

The reason to want some other binary format would be if there were
other benefits to be had.

An "XML encoding" format could be interesting if it allowed having
GIST-ish indexes to search for tags particularly efficiently. I say
"XML encoding" because I've not got any reason to think that a
JSON/BSON-only format would necessarily be preferable.

But "interesting" isn't the same thing as "the right answer." For
now, TOAST seems perfectly reasonable.

If there's some "wire format for XML" that would allow more efficient
data transfer, that would be an improvement. BSON sounds like it's
something like that, but only if it's better than "flavour of the
week."
--
http://linuxfinances.info/info/linuxdistributions.html

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2010-08-16 15:48:57 Re: JSON Patch for PostgreSQL - BSON Support?
Previous Message Dmitriy Igrishin 2010-08-16 15:33:33 Conflicted names of error conditions.