Leif Biberg Kristensen <leif@solumslekt.org> wrote:
> On Saturday 17. September 2011 19.07.03 Tim Landscheidt wrote:
>> Leif Biberg Kristensen <leif@solumslekt.org> wrote:
>> > UPDATE sources SET source_text = regexp_replace(source_text,
>> > E'n="(.*?)$1(.*?)"', E'n="\\1$2\\2"', 'g') where source_text like
>> > '%n="%$1%">%'
>> Try:
>> > UPDATE sources SET source_text = regexp_replace(source_text,
>> > CONCAT(E'n="(.*?)', $1, E'(.*?)"'), CONCAT(E'n="\\1', $2, '\\2"', 'g')
>> > where source_text like CONCAT('%n="%', $1, '%">%')
> The function CONCAT doesn't exist i PostgreSQL.
Eh, yes, of course.
> And I can't get it to work
> with EXECUTE and standard concatenation either:
> [...]
What do you need the EXECUTE for? Just drop it.
Tim