Darren Ferguson wrote:
> There is a function called TRANSLATE
>
> This will do the trick
>
> HTH
TRANSLATE performs a character-by-character replacement. You
cannot use TRANSLATE to substitute words or phrases. Example:
SELECT TRANSLATE('mikei', 'ike', '*8p');
m*8p*
all i's->*
all k's->8
all e's->p
You must either write your own replace(), or use the one
included in 7.3 as Joe Conway mentioned.
Mike Mascari
mascarm@mascari.com
>
> On Thu, 7 Nov 2002, 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?