Re: [GENERAL] Gripe: bytea_output default => data corruption - Mailing list pgsql-docs

From ljb
Subject Re: [GENERAL] Gripe: bytea_output default => data corruption
Date
Msg-id iif06v$2et7$1@news.hub.org
Whole thread Raw
In response to Re: [GENERAL] Gripe: bytea_output default => data corruption  (Bruce Momjian <bruce@momjian.us>)
Responses Re: [GENERAL] Gripe: bytea_output default => data corruption  (Bruce Momjian <bruce@momjian.us>)
List pgsql-docs
bruce@momjian.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.

pgsql-docs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Change to kernel-resources
Next
From: Peter Eisentraut
Date:
Subject: Re: Change to documentation headers