Skip site navigation (1) Skip section navigation (2)

Re: PQescapeString

From: Mark Thomas <thomas(at)pbegames(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: PQescapeString
Date: 2002-06-08 17:29:15
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
At 11:36 AM 6/8/02 -0400, Tom Lane wrote:
>Mark Thomas <thomas(at)pbegames(dot)com> writes:
> > ... I end up with a query string that looks like:
> > INSERT INTO "some_table" (ttext)
> > VALUES ('This is a test of postgresql''s escaping mechanism')
>That should result in inserting
>         This is a test of postgresql's escaping mechanism
> > Subsequently I do:
> > SELECT ttext from "some_table";
> > This is a test of postgresql''s escaping mechanism
>This is hard to believe.  The returned string shouldn't have the
>doubled quote.  You're going to have to give more details about
>what you're doing.

The technical term is 'being stupid' :( I was being a bit too careful about 
my string cleaning and invoking PQescapeString twice, which explains the 
results I was seeing perfectly. Thanks for the answer.

Mark Thomas
thomas(at)pbegames(dot)com ---->
Play by Electron Games -> Free Trial Games

In response to

pgsql-novice by date

Next:From: Tom LaneDate: 2002-06-08 20:18:40
Subject: Re: HELP! Cannot access table!!!!
Previous:From: Tom LaneDate: 2002-06-08 15:36:19
Subject: Re: PQescapeString

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group