Re: replace text function

From: "Mark Wilson" <mark(at)mediasculpt(dot)com>
To: "Joe Conway" <mail(at)joeconway(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: replace text function
Date: 2002-11-07 03:51:52
Message-ID: 053901c28611$05ab3eb0$3301a8c0@merl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Must be a slow posting day today :~)

Thanks everyone. I'm running PostGreSQL 7.2.1 and have run in the replace
function that numerous people sent me. It works exactly as I would expect
it to.

Cheers,
Mark

----- Original Message -----
From: "Joe Conway" <mail(at)joeconway(dot)com>
To: "Mark Wilson" <mark(at)mediasculpt(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Sent: Thursday, November 07, 2002 11:51 AM
Subject: Re: [GENERAL] replace text function

> 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
>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lee Tuck 2002-11-07 04:37:37 jdbc problem
Previous Message Mike Mascari 2002-11-07 03:10:25 Re: replace text function