regexp_replace failing on 9.0.4 - Mailing list pgsql-general

From Rob Sargent
Subject regexp_replace failing on 9.0.4
Date
Msg-id 51475DE8.3070804@gmail.com
Whole thread Raw
Responses Re: regexp_replace failing on 9.0.4
List pgsql-general
On our 9.0.4[1] server my regexp_replace is a no-op, but on the 9.0.3[2]
test machine and my 9.1.2[3] dev box all is fine

This is may statement

update cms.segment_data s
set text = regexp_replace(s.text,
      '(^.*)ns/acres/pathology/dx/1.5(.*$)',
     E'\\1ns/acres/pathology/dx/1.6\\2')
from
   dm.payload_segment p,
   support.fix_pathdx_namespace f
where s.id  = p.segment_data_id
and p.item_id = f.item_id
and p.content_version = f.maxversion
;

"UPDATE 76" reported, but zero changes persist



When I just select the regexp like so

select legacy_id,
regexp_replace( substring(s.text, 1, 150) ,
'(^.*)ns/acres/pathology/dx/1.5(.*$)',
E'\\1ns/acres/pathology/dx/1.6\\2')
from
   dm.payload_segment p,
   support.fix_pathdx_namespace f,
   cms.segment_data s
where s.id  = p.segment_data_id
       and p.item_id = f.item_id
       and p.content_version = f.maxversion
;

I get the corrected data (chiefly the "1.6")

Can anyone see where I've gone off track?



[1]PostgreSQL 9.0.4 on x86_64-unknown-linux-gnu, compiled by GCC gcc
(SUSE Linux) 4.5.0 20100604 [gcc-4_5-branch revision 160292], 64-bit

[2]PostgreSQL 9.0.3 on x86_64-unknown-linux-gnu, compiled by GCC gcc
(SUSE Linux) 4.5.0 20100604 [gcc-4_5-branch revision 160292], 64-bit

[3]PostgreSQL 9.1.2 on x86_64-unknown-linux-gnu, compiled by gcc
(Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1, 64-bit


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: When did this behavior change (and where else might it bite me)?
Next
From: Tom Lane
Date:
Subject: Re: regexp_replace failing on 9.0.4