Re: how to do a find and replace

From: Hélder M(dot) Vieira <hmv(at)mail(dot)telepac(dot)pt>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: how to do a find and replace
Date: 2005-11-18 01:10:17
Message-ID: 06c001c5ebdc$d6d4cd10$580bfea9@hmv02
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Aftab Alam 2005-11-18 05:25:24 query
Previous Message Bricklen Anderson 2005-11-18 00:12:37 Re: how to do a find and replace