Re: Stripping apostrophes from data - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Stripping apostrophes from data
Date
Msg-id 20070820163549.GD20465@svana.org
Whole thread Raw
In response to Stripping apostrophes from data  (Andrew Edson <cheighlund@yahoo.com>)
List pgsql-general
On Mon, Aug 20, 2007 at 09:19:14AM -0700, Andrew Edson wrote:
> Is there some program or procedure for stripping apostrophes (') from
> data in the db?  Most of our data has been shuffled over to Postgres
> from an older system, and I'm occasionally running into data entered
> in the old system that has apostrophes in it.  (Most recent example:
> A name field with the word "Today's" in it.) Given that most of my
> interactions with the database are through perl scripts and php
> pages, I can't always tell ahead of time what field I need is going
> to contain data that's deadly to my statements.
>
>   Alternately, is there some way of inserting or selecting data from
>   the db which doesn't require the use of apostrophes for non-numeric
>   fields?

Umm, why are apostrophes causing a problem? Normally you just escape
them or, if you don't want to worry about them at all, use queries with
placeholders.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Stripping apostrophes from data
Next
From: "Livia Santos"
Date:
Subject: Re: Table description