Re: [GENERAL] Gripe: bytea_output default => data corruption

From: ljb <ljb9832(at)pobox(dot)com>
To: pgsql-docs(at)postgresql(dot)org
Subject: Re: [GENERAL] Gripe: bytea_output default => data corruption
Date: 2011-02-03 19:38:07
Message-ID: iif06v$2et7$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

bruce(at)momjian(dot)us wrote:
>...
>> Based on this report, I have created the attached documentation patch
>> which clarifies the libpq behavior for escaping bytea. I am planning to
>> backpatch this to 9.0 as well.

This change says PQescapeBytea is unable to adjust its behavior based on
bytea_output, implying that PQescapeByteaConn does adjust its behavior
based on byte_output. Wrong! Neither one knows or cares about the bytea_output
parameter, which is solely for the backend to tell it how to present bytea
data to the front-end. Not for the front-ends at all.

(See why we need this behavior documented?)

Non-use of 'standard_conforming_strings' is also wrong, in the current
(pre-patched) docs. PQescapeBytea does adjust its behavior for
standard_conforming_strings, but only for the single-connection case. See
similar text for PQescapeString.

Regarding the first paragraph changed, it seems off to me. "PQescapeByteConn
escapes such bytes using either hex encoding..." tells me that when hex
encoding is used, PQescapeByte encodes only bytes that need escaping. Not
true - hex encoding encodes (not escapes) every byte.

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Peter Eisentraut 2011-02-04 16:01:39 Re: Change to documentation headers
Previous Message Bruce Momjian 2011-02-03 17:12:01 Re: Change to kernel-resources