X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id D004CD1B967 for ; Sat, 20 Sep 2003 17:25:07 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 39117-09 for ; Sat, 20 Sep 2003 14:24:36 -0300 (ADT) Received: from anchor-post-32.mail.demon.net (anchor-post-32.mail.demon.net [194.217.242.90]) by svr1.postgresql.org (Postfix) with ESMTP id CFCE2D1B58C for ; Sat, 20 Sep 2003 14:23:51 -0300 (ADT) Received: from lfix.demon.co.uk ([80.177.205.209] helo=cerberus.lfix.co.uk) by anchor-post-32.mail.demon.net with esmtp (Exim 3.35 #1) id 1A0lSZ-000K6A-0W; Sat, 20 Sep 2003 18:23:51 +0100 Received: from linda.lfix.co.uk ([192.168.1.1]) by cerberus.lfix.co.uk with esmtp (Exim 4.22) id 1A0lSM-0007zy-G3; Sat, 20 Sep 2003 18:23:38 +0100 Subject: Re: How to insert a string with single quotes in the From: Oliver Elphick To: Louise Cofield Cc: pgsql-interfaces@postgresql.org In-Reply-To: <030701c37ef1$493739c0$7801a8c0@Louise> References: <030701c37ef1$493739c0$7801a8c0@Louise> Content-Type: text/plain Organization: LFIX Limited Message-Id: <1064078648.5362.559.camel@linda.lfix.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Sat, 20 Sep 2003 18:24:08 +0100 Content-Transfer-Encoding: 7bit X-LFIX-MailScanner: Found to be clean X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/49 X-Sequence-Number: 4467 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