Re: Wire protocol: type-specific opt-in to binary format

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Florian Weimer <fweimer(at)bfk(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Wire protocol: type-specific opt-in to binary format
Date: 2011-11-24 16:47:31
Message-ID: 24437.1322153251@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Florian Weimer <fweimer(at)bfk(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-11-24 17:00:54 Re: Time bug with small years
Previous Message Tom Lane 2011-11-24 16:47:16 Re: Making TEXT NUL-transparent