Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 8EAEA1336FA7 for ; Mon, 25 Oct 2010 20:19:27 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 76657-02 for ; Mon, 25 Oct 2010 23:19:21 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 10B2C133616B for ; Mon, 25 Oct 2010 20:19:19 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o9PNIo07008605; Mon, 25 Oct 2010 19:18:50 -0400 (EDT) To: Bruce Momjian cc: ljb , PostgreSQL-documentation Subject: Re: [GENERAL] Gripe: bytea_output default => data corruption In-reply-to: <201010212342.o9LNgEu17871@momjian.us> References: <201010212342.o9LNgEu17871@momjian.us> Comments: In-reply-to Bruce Momjian message dated "Thu, 21 Oct 2010 19:42:14 -0400" Date: Mon, 25 Oct 2010 19:18:49 -0400 Message-ID: <8604.1288048729@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/50 X-Sequence-Number: 6191 Bruce Momjian writes: > Yikes, you are right! I see: > http://www.postgresql.org/docs/9.0/static/libpq-exec.html#LIBPQ-EXEC-ESCAPE-STRING > PQescapeByteaConn > ... > Certain byte values must be escaped (but all byte values can be escaped) > when used as part of a bytea literal in an SQL statement. In general, to > --> escape a byte, it is converted into the three digit octal number equal > to the octet value, and preceded by usually two backslashes. The single > quote (') and backslash (\) characters have special alternative escape > sequences. See Section 8.4 for more information. PQescapeByteaConn > performs this operation, escaping only the minimally required bytes. > Can someone suggest some updated wording? Thanks. I think we should simply remove the description of *how* the escaping is performed, and state only that the function produces a suitably escaped literal string. Anything else is not future-proof, and could someday break the way this wording did. regards, tom lane