Search Postgresql Archives

regexp_replace

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

 



Hi all,

I would like to change a sub-string in a text-field by using

UPDATE tablename SET
fieldname=regexp_replace(fieldname,old_sub_string,new_sub_string)
WHERE (fieldname like '%old_sub_string%')

In priniciple, it works. However, only one occurence of old_sub_string
is replaced and further not. Which syntax has to be used to replace
all old_sub_strings by new_sub_string in a text-field at once? I have
seen something like '\&' in the docs and tried it, but I failed.

Any Idea? Thanks a lot!

Ciao,
Tino



[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