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

2011-06-30 Thread Andreas
Am 01.07.2011 04:17, schrieb Tim Landscheidt: besides the regexp_replace() solution mentioned by Charlie and Steve, you can also use TRANSLATE(): | tim=# SELECT TRANSLATE('a{b''c"d!f', '{}()''",;.:!', ''); nice, 2 solutions for 1 problem. :) my replace...replace... was a wee bit tedious ;)

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

2011-06-30 Thread Tim Landscheidt
(anonymous) wrote: > 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 elega

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

2011-06-30 Thread Charlie
Would regexp_replace(src_str, '[\{\}\[\]\(\)\.', '') at http://www.postgresql.org/docs/9.0/static/functions-string.html help? - Reply message - From: "Andreas" Date: Thu, Jun 30, 2011 4:28 pm Subject: [SQL] How to remove a set of characters in text-columns ? To: Hi, how can I re

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

2011-06-30 Thread Steve Crawford
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

[SQL] How to remove a set of characters in text-columns ?

2011-06-30 Thread Andreas
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 ? rega