pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
[PATCH] Comments in PGbytea byte[] to pgstring conversion
2+ messages / 2 participants
[nested] [flat]

* [PATCH] Comments in PGbytea byte[] to pgstring conversion
@ 2006-11-05 21:28  Michael Paesold <mpaesold@gmx.at>
  0 siblings, 1 reply; 2+ messages in thread

From: Michael Paesold @ 2006-11-05 21:28 UTC (permalink / raw)
  To: pgsql-jdbc

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

Attachments:

bytea-to-pgstring-comments.patch (text/x-patch, 1.6K) download 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
^ permalink raw reply [nested|flat] 2+ messages in thread

* Re: [PATCH] Comments in PGbytea byte[] to pgstring conversion
@ 2006-11-06 05:50  Kris Jurka <books@ejurka.com>
  parent: Michael Paesold <mpaesold@gmx.at>
  0 siblings, 0 replies; 2+ messages in thread

From: Kris Jurka @ 2006-11-06 05:50 UTC (permalink / raw)
  To: Michael Paesold <mpaesold@gmx.at>; +Cc: pgsql-jdbc



On Sun, 5 Nov 2006, Michael Paesold wrote:

> 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).
>

Applied.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2006-11-06 05:50 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-11-05 21:28 [PATCH] Comments in PGbytea byte[] to pgstring conversion Michael Paesold <mpaesold@gmx.at>
2006-11-06 05:50 ` Kris Jurka <books@ejurka.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox