Re: Problem with replace

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Problem with replace
Дата
Msg-id b42b73150701241851m247c5d27v1f2eccfb2c571edb@mail.gmail.com
обсуждение исходный текст
Ответ на Problem with replace  ("slawosz" <slawosz@gmail.com>)
Список pgsql-general
On 23 Jan 2007 13:05:41 -0800, slawosz <slawosz@gmail.com> wrote:
> Hello,
> I have to relpace string
> http://example.com/index.php?module=articles&id= to string /module/ in
> whole column in table. How exacly use replace? I noob in postgres, I
> think it could be quite easy.
> Please, help

try replace command for simple things:
Administrator=# select replace ('abcdef', 'ab', '12');
 replace
---------
 12cdef
(1 row)

(to do the whole table, do:)
update foo set bar = replace(bar, ab, '12');

for more complex things use regex_replace() (see docs)

merlin

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

Предыдущее
От: Ken Johanson
Дата:
Сообщение: Re: Example of RETURNING clause to get auto-generated keys
Следующее
От: "Merlin Moncure"
Дата:
Сообщение: Re: Idle in transaction - Explination ..