LP#
1802166: (follow-up) document a way to clear names from already-purged patron records
For reference, the following SQL will clear the preferred name
and name keyword fields from already-purged records:
UPDATE actor.usr
SET pref_prefix = NULL,
pref_first_given_name = NULL,
pref_second_given_name = NULL,
pref_family_name = NULL,
pref_suffix = NULL,
name_keywords = NULL
WHERE usrname ~ ('^' || id || '-PURGED')
AND NOT active
AND deleted
AND (
pref_prefix IS NOT NULL OR
pref_first_given_name IS NOT NULL OR
pref_second_given_name IS NOT NULL OR
pref_family_name IS NOT NULL OR
pref_suffix IS NOT NULL OR
name_keywords IS NOT NULL
);
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>