Data mangling

16/09/16

Permalink 09:54:59 am, by Greg, 69 words, 53 views   English (CA)
Categories: Activity log; Mins. worked: 60

Data mangling

When I imported the data I seem to have run strings through an escape routine twice, producing results like Jack O''Connor (note the double single quote. Replacing them was a bit of a hassle, but the logic is pretty simple:
UPDATE person SET surname = regexp_replace(surname, '''''', '''', 'g') WHERE surname like '%''''%';

I then had to refresh the materialized view:
REFRESH MATERIALIZED VIEW person_mv;

Pingbacks:

No Pingbacks for this post yet...

CGWP

Reports

XML Feeds