Re: replace text function

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: replace text function
Дата
Msg-id 3DC99CED.9040404@joeconway.com
обсуждение исходный текст
Ответ на Re: i have got an error  ("scott.marlowe" <scott.marlowe@ihs.com>)
Список pgsql-general
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




В списке pgsql-general по дате отправления:

Предыдущее
От: "Mark Wilson"
Дата:
Сообщение: replace text function
Следующее
От: Darren Ferguson
Дата:
Сообщение: Re: replace text function