Search Postgresql Archives

Re: Problem with replace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 23 Jan 2007 13:05:41 -0800, slawosz <slawosz@xxxxxxxxx> 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux