Re: how to do a find and replace - Mailing list pgsql-sql

From Hélder M. Vieira
Subject Re: how to do a find and replace
Date
Msg-id 06c001c5ebdc$d6d4cd10$580bfea9@hmv02
Whole thread Raw
In response to timestamp SQL question  (Brian Doyle <bdoyle@localmatters.com>)
List pgsql-sql
> update media_instance set location=replace(location,'v.','')
> where location like '%/0/v.%'


For more complex search/replace operations, 8.1 provides an interesting 
function, named 'regexp_replace'.
It probably goes unnoticed because although there is a small reference in 
the manual in section 'E.1.3.6. Data Type and Function Changes'
(http://www.postgresql.org/docs/8.1/interactive/release.html#RELEASE-8-1) 
and a description in section '9.7.3 POSIX Regular expressions' 
(http://www.postgresql.org/docs/8.1/interactive/functions-matching.html), it 
isn't mentioned in section '9.4. String Functions and Operators' 
(http://www.postgresql.org/docs/8.1/interactive/functions-string.html).


Hélder M. Vieira










pgsql-sql by date:

Previous
From: Bricklen Anderson
Date:
Subject: Re: how to do a find and replace
Next
From: "A. Kretschmer"
Date:
Subject: Re: how to do a find and replace