regexp_replace failing on 9.0.4

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: regexp_replace failing on 9.0.4
Date: 2013-03-18 18:33:12
Message-ID: 51475DE8.3070804@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2013-03-18 19:19:53 Re: regexp_replace failing on 9.0.4
Previous Message Katherine Jeschke 2013-03-18 18:27:56 Surge 2013 CFP Open