<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.6.6">
</HEAD>
<BODY>
Hi Folks,<BR>
<BR>
Can anyone else confirm or deny the issue I outlined below?<BR>
<BR>
I should add that this is on PgPool-II Version 3.3 with PostgreSQL 9.2.4 backends...<BR>
<BR>
I'd really like a solution (or work-around) - other than rewriting the client applications! ;-)<BR>
<BR>
Regards,<BR>
<BR>
Andy Bruce<BR>
<BR>
Date: Wed, 21 Aug 2013 16:27:49 +0100<BR>
From: &quot;Andrew Bruce&quot; &lt;<A HREF="mailto:andrew.bruce@hslmobile.com">andrew.bruce@hslmobile.com</A>&gt;<BR>
To: &lt;<A HREF="mailto:pgpool-general@pgpool.net">pgpool-general@pgpool.net</A>&gt;<BR>
Subject: [pgpool-general: 2061] standard_conforming_strings broken by<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PgPool?<BR>
<BR>
Hi folks,<BR>
<BR>
I'm looking at an interesting problem:<BR>
<BR>
I have client software that needs to use the backslash character as an<BR>
escape character. For a regular PostgreSQL database, this is not a<BR>
problem as the parameter 'standard_conforming_strings' can be turned<BR>
'off' and queries such as:<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SELECT '\''; <BR>
<BR>
will correctly return:<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?column?<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;----------<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(1 row)<BR>
<BR>
However, if I try to do this on the cluster, through PgPool, despite<BR>
turning off standard_conforming_strings, the backslash is still treated<BR>
as a literal string character, so the result of the above query becomes:<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;postgres=# select '\'';<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;postgres'#<BR>
<BR>
indicating that the CLI suspects that I have failed to close the single<BR>
quotes...<BR>
<BR>
To reproduce:<BR>
<BR>
Connect to the DB cluster using the PgPool IP address:<BR>
--- Begin Output from PgPool Connection ---<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sampledb=# select '\'';<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sampledb'# ^C<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sampledb=# set standard_conforming_strings = 'off';<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SET<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sampledb=# select '\'';<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sampledb'# ^C<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sampledb=# \q<BR>
--- End Output from PgPool Connection ---<BR>
<BR>
<BR>
Connect directly to one of the PostgreSQL database servers in the<BR>
cluster, bypassing PgPool:<BR>
--- Begin Output from Dedicated DB Connection ---<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sampledb=# select '\'';<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sampledb'# ^C<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sampledb=# set standard_conforming_strings = 'off';<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SET<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;postgres=# select '\'';<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WARNING:&nbsp; nonstandard use of \' in a string literal<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LINE 1: select '\'';<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HINT:&nbsp; Use '' to write quotes in strings, or use the escape<BR>
string syntax (E'...').<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ?column?<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;----------<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(1 row)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sampledb=# \q<BR>
--- End Output from Dedicated DB Connection ---<BR>
<BR>
Is this a known issue, or is there something I'm missing here?<BR>
<BR>
Thanks in advance of any helpful advice!<BR>
<BR>
Regards,<BR>
<BR>
Andy Bruce
</BODY>
</HTML>