Re: "'" in SQL INSERT statement - Mailing list pgsql-sql

From Brett W. McCoy
Subject Re: "'" in SQL INSERT statement
Date
Msg-id Pine.LNX.4.30.0101250547420.10432-100000@chapelperilous.net
Whole thread Raw
In response to "'" in SQL INSERT statement  (Markus Wagner <wagner@imsd.uni-mainz.de>)
List pgsql-sql
On Thu, 25 Jan 2001, Markus Wagner wrote:

> I have some data that I wish to transfer into a database using perl/DBI.
> Some of the data are strings containing the apostrophe "'" which I use
> as string delimiter.
>
> How can I put these into my database using the INSERT statement?

You will need to escape them with the \ character.  So "Bill's Garage"
will become "Bill\'s Garage".

-- Brett                                    http://www.chapelperilous.net/~bmccoy/
---------------------------------------------------------------------------
Romeo wasn't bilked in a day.    -- Walt Kelly, "Ten Ever-Lovin' Blue-Eyed Years With Pogo"



pgsql-sql by date:

Previous
From: Alessio Bragadini
Date:
Subject: Re: "'" in SQL INSERT statement
Next
From: Roberto Bertolusso
Date:
Subject: Cannot CREATE INDEX that contains a function