Re: jsonb and nested hstore - Mailing list pgsql-hackers

From Tom Lane
Subject Re: jsonb and nested hstore
Date
Msg-id 9645.1392045237@sss.pgh.pa.us
Whole thread Raw
In response to Re: jsonb and nested hstore  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-hackers
Craig Ringer <craig@2ndquadrant.com> writes:
> On 02/06/2014 01:48 AM, Tom Lane wrote:
>>> switching to "binary is the same as text" may well be the most prudent
>>> path here.

> Can't we just reject attempts to transfer these via binary copy,
> allowing only a text format? So rather than sending text when the binary
> is requested, we just require clients to use text for this type.

That used to be the case, back when we didn't have send/recv functions for
all built-in types; and client-code authors complained bitterly about it.
It's pretty much unworkable if the text/binary choice is being made by
a code level that doesn't have complete understanding of the queries it's
transmitting.  Consider "SELECT * FROM ..."; how are you going to know
which columns to request in binary and which in text?  Even if you're
willing to do trial and error (ie, it's okay to cause transaction
rollbacks), the backend isn't very helpful about telling you exactly
which column(s) would need to be requested as text.

I think the downthread solution of prepending a type-specific format ID
byte is a better answer for giving us flexibility down the road.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Performance Improvement by reducing WAL for Update Operation
Next
From: Tom Lane
Date:
Subject: Re: Breaking compile-time dependency cycles of Postgres subdirs?