Re: Wire protocol: type-specific opt-in to binary format - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Wire protocol: type-specific opt-in to binary format
Date
Msg-id 24437.1322153251@sss.pgh.pa.us
Whole thread Raw
In response to Wire protocol: type-specific opt-in to binary format  (Florian Weimer <fweimer@bfk.de>)
List pgsql-hackers
Florian Weimer <fweimer@bfk.de> writes:
> I would like to add functionality which allows a client to tell the
> server which types can be sent in binary format.  The immediate goal is
> to suppress hex quoting for BYTEA values, but it seems to make sense to
> make this functionality more general.

> This doesn't have to be a flag on the wire protocol, it could be a
> regular run-time parameter.

> Do you think this would make sense?

No.  Especially not as a GUC.  People have gotten this idea that they
can whack behavior around arbitrarily under the control of some GUC or
other, and that won't break things and create security holes.  Generally
that's way too optimistic, and I think it's way too optimistic in this
particular case.  As near as I can tell, you are proposing a GUC that
will cause the server to flat-out violate the existing protocol
document, ie send something in binary when the client's request clearly
specified text (or perhaps vice versa).  That is a recipe for breakage,
not a recipe for making anybody's life better.

It might be good to add some ability like this when we do the next set
of protocol revisions.  But trying to pretend that it's not a protocol
change will lead to nothing but a dangerous kluge.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Making TEXT NUL-transparent
Next
From: Tom Lane
Date:
Subject: Re: Time bug with small years