Re: Stripping apostrophes from data

From: Viatcheslav Kalinin <vka(at)ipcb(dot)net>
To: Andrew Edson <cheighlund(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Stripping apostrophes from data
Date: 2007-08-20 16:43:09
Message-ID: 46C9C49D.90807@ipcb.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?
>
> ------------------------------------------------------------------------
> Luggage? GPS? Comic books?
> Check out fitting gifts for grads
> <http://us.rd.yahoo.com/evt=48249/*http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz>
> at Yahoo! Search.
In php you can use |pg_escape_string function:

http://us3.php.net/manual/en/function.pg-escape-string.php|

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Leon Mergen 2007-08-20 17:08:50 Re: Stripping apostrophes from data
Previous Message Michael Glaesemann 2007-08-20 16:43:03 Re: Stripping apostrophes from data