Hi!
On Mon, Jun 25, 2012 at 06:49:03AM +0200, Tom Coetser <su...@ic...> wrote:
> On Friday 22 June 2012 21:42:28 Oleg Broytman wrote:
> > Tom, can I see the values for the following configuration parameters:
> >
> > grep 'standard_conforming_strings\|escape_string_warning\|backslash_quote'
> > /etc/postgresql/9.1/main/postgresql.conf
> >
> > Mine are:
> >
> > #backslash_quote = safe_encoding # on, off, or safe_encoding
> > #escape_string_warning = on
> > #standard_conforming_strings = on
>
> I am still running PostgreSQL 8.4 :
>
> $ grep 'standard_conforming_strings\|escape_string_warning\|backslash_quote'
> /etc/postgresql/8.4/main/postgresql.conf
>
> #backslash_quote = safe_encoding # on, off, or safe_encoding
> #escape_string_warning = on
> #standard_conforming_strings = off
Thanks. Everything is default. Ok.
> > I'm trying to understand the difference in our setup...
>
> Could it be the PostgreSQL version?
I am not sure. The problem seems to be I need to double backslashes
when I use E'' escaped strings and that backslash doubling takes place
long before SQLObject passes the string to the backend. Without
backslash doubling Postgres report problems with encodings - all
encodings I tried: latin1, koi8-r, utf-8.
Without E'' escaped strings - i.e., with plain ''-quoted strings with
backslashes - I do not need to double backslashes, and Pg doesn't
generate warnings about E'' escapes.
It seems in your case backslashes must not be doubled, and E''
escapes suppress warnings. Yes, it could be a difference in Pg versions.
So for now my resolution is: I'm removing the patch from SQLObject
because without it SQLObject works fine with different versions of Pg;
to suppress warnings about E'' escapes try to set
escape_string_warning = off
and restart Postgres. I'm saving the patch to a file for future
pondering.
Oleg.
--
Oleg Broytman http://phdru.name/ ph...@ph...
Programmers don't die, they just GOSUB without RETURN.
|