Re: standard_conforming_strings and pg_escape_string()

From: Conrad Lender <crlender(at)gmail(dot)com>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: standard_conforming_strings and pg_escape_string()
Date: 2009-04-24 18:30:45
Message-ID: 49F20555.2070505@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 24/04/09 14:49, Daniel Verite wrote:
> It works for me:
>
> $ php -e
> <?
> echo phpversion(), "\n";
> $c=pg_connect("dbname=mail user=daniel host=/tmp port=5000");
> pg_query("SET standard_conforming_strings=off");
> echo pg_escape_string('toto\titi'), "\n";
> pg_query("SET standard_conforming_strings=on");
> echo pg_escape_string('toto\titi'), "\n";
> ?>
>
> Output:
> 5.2.0-8+etch13
> toto\\titi
> toto\titi

Very interesting! That's exactly what I had hoped would happen, but for
some reason it didn't. I've managed to replicate this with a standalone
test script, which means that here must be something else going wrong in
our application.

Thank you all for your help!

- Conrad

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-04-24 19:03:06 Re: Selling an 8.1 to 8.3 upgrade
Previous Message Johan Nel 2009-04-24 18:27:33 Determining the names of columns in a dynamic query