From: Oliver Elphick <olly@lfix.co.uk>
To: Louise Cofield <lcofield@box-works.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: How to insert a string with single quotes in the
Date: Sat, 20 Sep 2003 18:24:08 +0100
Message-ID: <1064078648.5362.559.camel@linda.lfix.co.uk> (raw)
In-Reply-To: <030701c37ef1$493739c0$7801a8c0@Louise>
References: <030701c37ef1$493739c0$7801a8c0@Louise>
On Fri, 2003-09-19 at 22:02, Louise Cofield wrote:
> I am creating a Libpq program that reads a text file,
...
> The insert blows up when it hits an item description that contains a
> single quote in the text.
You also have to look out for backslashes.
> Other than stripping the offending quote-marks from the text prior to
> processing, does anybody have any ideas how I can deal with this?
The libpq library includes the function PQescapeString, as described in
the manual.
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"But my God shall supply all your need according to his
riches in glory by Christ Jesus." Philippians 4:19
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: olly@lfix.co.uk, lcofield@box-works.com
Subject: Re: How to insert a string with single quotes in the
In-Reply-To: <1064078648.5362.559.camel@linda.lfix.co.uk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox