Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 316CE9FA4A0 for ; Sun, 5 Nov 2006 17:28:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 81167-02 for ; Sun, 5 Nov 2006 17:28:33 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by postgresql.org (Postfix) with SMTP id 3E7169F976E for ; Sun, 5 Nov 2006 17:28:33 -0400 (AST) Received: (qmail invoked by alias); 05 Nov 2006 21:28:31 -0000 Received: from 85-125-151-239.dynamic.xdsl-line.inode.at (EHLO [192.168.1.15]) [85.125.151.239] by mail.gmx.net (mp038) with SMTP; 05 Nov 2006 22:28:31 +0100 X-Authenticated: #1946847 Message-ID: <454E577E.3040904@gmx.at> Date: Sun, 05 Nov 2006 22:28:30 +0100 From: Michael Paesold User-Agent: Thunderbird 1.5.0.7 (X11/20060915) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: [PATCH] Comments in PGbytea byte[] to pgstring conversion Content-Type: multipart/mixed; boundary="------------090803000403000706090507" X-Y-GMX-Trusted: 0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/28 X-Sequence-Number: 16070 This is a multi-part message in MIME format. --------------090803000403000706090507 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Change the comments in org.postgresql.util.PGbytea to clarify that the backslashes are given twice as often as required by the backend because of how Java processes string literals (and not because of the backend's parser). Best Regards Michael Paesold --------------090803000403000706090507 Content-Type: text/x-patch; name="bytea-to-pgstring-comments.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="bytea-to-pgstring-comments.patch" diff -crN pgjdbc.bb8feffc6a34/org/postgresql/util/PGbytea.java pgjdbc/org/postgresql/util/PGbytea.java *** pgjdbc.bb8feffc6a34/org/postgresql/util/PGbytea.java 2006-11-05 22:23:38.000000000 +0100 --- pgjdbc/org/postgresql/util/PGbytea.java 2006-11-05 22:23:38.000000000 +0100 *************** *** 116,122 **** if (l_int < 040 || l_int > 0176) { //escape charcter with the form \000, but need two \\ because of ! //the parser l_strbuf.append("\\"); l_strbuf.append((char)(((l_int >> 6) & 0x3) + 48)); l_strbuf.append((char)(((l_int >> 3) & 0x7) + 48)); --- 116,122 ---- if (l_int < 040 || l_int > 0176) { //escape charcter with the form \000, but need two \\ because of ! //the Java parser l_strbuf.append("\\"); l_strbuf.append((char)(((l_int >> 6) & 0x3) + 48)); l_strbuf.append((char)(((l_int >> 3) & 0x7) + 48)); *************** *** 125,131 **** else if (p_buf[i] == (byte)'\\') { //escape the backslash character as \\, but need four \\\\ because ! //of the parser l_strbuf.append("\\\\"); } else --- 125,131 ---- else if (p_buf[i] == (byte)'\\') { //escape the backslash character as \\, but need four \\\\ because ! //of the Java parser l_strbuf.append("\\\\"); } else --------------090803000403000706090507--