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

BUG #2478: PQescapeStringConn

From: "Ian Howle" <Ian(at)qwizdom(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2478: PQescapeStringConn
Date: 2006-06-12 16:00:57
Message-ID: 200606121600.k5CG0vc9023128@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      2478
Logged by:          Ian Howle
Email address:      Ian(at)qwizdom(dot)com
PostgreSQL version: 8.1.4
Operating system:   Mac OS X 10.4.6
Description:        PQescapeStringConn
Details: 

When inserting into a TEXT or VARCHAR() table field, single quotes are
needed around the text. When using the PQescapeStringConn(), the beginning
and ending single quotes are escaped, causing the INSERT statement to fail.
I understand that this really isn't a bug and that the text being insterted
into the database should be scanned using PQescapeStringConn() before adding
the surrounding quotes.

I have a single method that deals with inserting data into the database,
which is called from many places throughout the application. It would be
nice if PQescapeStringConn() did not escape beginning and ending quotes,
just everything in between.

Thank you.

Responses

pgsql-bugs by date

Next:From: Bruce MomjianDate: 2006-06-12 16:09:12
Subject: Re: Fix for Win32 division involving INT_MIN
Previous:From: Jim C. NasbyDate: 2006-06-12 15:48:18
Subject: Re: BUG #2477: Aggregate Integer divisors incorrectly yield integer-type quotient

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