Re: How to remove a set of characters in text-columns ?

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: How to remove a set of characters in text-columns ?
Date: 2011-06-30 19:49:20
Message-ID: 4E0CD340.30809@pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 06/30/2011 12:28 PM, Andreas wrote:
> Hi,
> how can I remove a set of characters in text-columns ?
> Say I'd like to remove { } ( ) ' " , ; . : !
> Of course I can chain replace ( replace ( replace ( replace ( ... , ''
> ) .... and replace the chars one by one against an empty string ''.
>
> There might be a more elegant way.
> Is there ?
>
>
> regards
>
Look at regexp_replace()
http://www.postgresql.org/docs/9.0/static/functions-string.html
http://www.postgresql.org/docs/9.0/static/functions-matching.html#FUNCTIONS-POSIX-REGEXP

Cheers,
Steve

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Charlie 2011-06-30 19:57:08 Re: [SQL] How to remove a set of characters in text-columns ?
Previous Message Andreas 2011-06-30 19:28:47 How to remove a set of characters in text-columns ?