Re: PQescapeString - Mailing list pgsql-novice

From Mark Thomas
Subject Re: PQescapeString
Date
Msg-id 5.1.0.14.2.20020608132746.00accd90@pbegames.com
Whole thread Raw
In response to Re: PQescapeString  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
At 11:36 AM 6/8/02 -0400, Tom Lane wrote:
>Mark Thomas <thomas@pbegames.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@pbegames.com ----> http://www.pbegames.com/~thomas
Play by Electron Games -> http://www.pbegames.com Free Trial Games


pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: PQescapeString
Next
From: Tom Lane
Date:
Subject: Re: [GENERAL] HELP! Cannot access table!!!!