From: Steve Crawford <scrawford@pinpointresearch.com>
To: pgsql-sql@postgresql.org
Subject: Re: How to remove a set of characters in text-columns ?
Date: Thu, 30 Jun 2011 12:49:20 -0700
Message-ID: <4E0CD340.30809@pinpointresearch.com> (raw)
In-Reply-To: <4E0CCE6F.70001@gmx.net>
References: <4E0CCE6F.70001@gmx.net>
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.htmlhttp://www.postgresql.org/docs/9.0/static/functions-matching.html#FUNCTIONS-POSIX-REGEXP
Cheers,
Steve
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: scrawford@pinpointresearch.com
Subject: Re: How to remove a set of characters in text-columns ?
In-Reply-To: <4E0CD340.30809@pinpointresearch.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox