On Wed, 2006-11-08 at 07:00 -0800, Darcy Buskermolen wrote:
> On Tuesday 07 November 2006 15:03, Jeff Davis wrote:
> > I run slony and have escape_string_warning = on. Is there any interest
> > in preventing slony from using queries that cause that warning?
> >
> > We could either detect backends >= 8.1 and use E'' strings, or use
> > PQexecParams instead.
> >
> > Is there a reason that's not done? If I wrote such a patch, would it be
> > accepted, or would it be needless code complexity?
> 
> We could take the same approach with this as we did with standards conformant 
> strings, which is we set the guc's on the sesssions between the nodes.  Would 
> that fix your issue?
> 

Is it possible to get this change in before the release of 1.2.1? I
attached a quick patch.

Regards,
        Jeff Davis

--- slony1-1.2.1-rc1.orig/src/slon/dbutils.c    2006-10-27 13:09:56.000000000 -0700
+++ slony1-1.2.1-rc1/src/slon/dbutils.c 2006-11-13 17:22:31.000000000 -0800
@@ -139,6 +139,16 @@
                }
                PQclear(res);
        }
+       if (conn->pg_version >= 80100)
+       {
+               slon_mkquery(&query, "set escape_string_warning to 'off'");
+               res = PQexec(dbconn, dstring_data(&query));
+               if (!(PQresultStatus(res) == PGRES_COMMAND_OK))
+        {
+            slon_log(SLON_ERROR, "Unable to set the escape_string_warning to off\n");
+               }
+        PQclear(res);
+       }
        return conn;
 }

_______________________________________________
Slony1-general mailing list
[email protected]
http://gborg.postgresql.org/mailman/listinfo/slony1-general

Reply via email to