Mark Wilson wrote:
> Hi all,
>
> I'm trying to find a function that will replace one word with another in a
> string.
>
> e.g. select <replace function>('bob was here, bobina wasnt', 'bob', 'mike');
> will return "mike was here, mikeina wasnt"
>
> Is there such a function already written in PostGreSQL?
>
It is new in 7.3 (currently in beta). See the function called "replace" at:
http://developer.postgresql.org/docs/postgres/functions-string.html
test=# select replace('bob was here, bobina wasnt', 'bob', 'mike');
replace
------------------------------
mike was here, mikeina wasnt
(1 row)
HTH,
Joe