Replacing characters in a string

Поиск
Список
Период
Сортировка
От Luís de Sousa
Тема Replacing characters in a string
Дата
Msg-id AANLkTinT1GDVOPCZ64eSKYo-6zwazeoc2uOvWjWQr8tG@mail.gmail.com
обсуждение исходный текст
Ответы Re: Replacing characters in a string  (Thom Brown <thom@linux.com>)
Re: Replacing characters in a string  (Szymon Guz <mabewlun@gmail.com>)
Re: Replacing characters in a string  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: Replacing characters in a string  (Sergey Konoplev <gray.ru@gmail.com>)
Re: Replacing characters in a string  (Michele Petrazzo - Unipex <michele.petrazzo@unipex.it>)
Список pgsql-general
Hello everyone,

I need to replace all occurrences of a certain character in a string.
For that I'm using regexp_replace, but so far I only managed to
replace the first character, here's an example:

> SELECT regexp_replace('xaxx', 'x', 'e');
 regexp_replace
----------------
 eaxx
(1 row)

But the result I'd need is 'eaee'. How can I do it?

Thanks,

Luís

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

Предыдущее
От: A B
Дата:
Сообщение: What filesystem to use for postgres?
Следующее
От: Thom Brown
Дата:
Сообщение: Re: Replacing characters in a string