[open-ils-commits] r11353 - trunk/Open-ILS/src/sql/Pg
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Nov 26 08:49:32 EST 2008
Author: erickson
Date: 2008-11-26 08:49:31 -0500 (Wed, 26 Nov 2008)
New Revision: 11353
Modified:
trunk/Open-ILS/src/sql/Pg/099.functions.global.sql
Log:
fixed some faulty sql user-merge logic
Modified: trunk/Open-ILS/src/sql/Pg/099.functions.global.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/099.functions.global.sql 2008-11-26 05:11:53 UTC (rev 11352)
+++ trunk/Open-ILS/src/sql/Pg/099.functions.global.sql 2008-11-26 13:49:31 UTC (rev 11353)
@@ -23,15 +23,14 @@
BEGIN
sel := 'SELECT id::BIGINT FROM ' || table_name || ' WHERE ' || quote_ident(col_name) || ' = ' || quote_literal(src_usr);
upd := 'UPDATE ' || table_name || ' SET ' || quote_ident(col_name) || ' = ' || quote_literal(dest_usr) || ' WHERE id = ';
- del := 'DELETE FROM ' || table_name || ' WHERE ' || quote_ident(col_name) || ' = ' || quote_literal(src_usr);
+ del := 'DELETE FROM ' || table_name || ' WHERE id = ';
FOR cur_row IN EXECUTE sel LOOP
BEGIN
- upd := upd || cur_row.id;
- -- RAISE NOTICE 'Attempting to merge % %', table_name, cur_row.id;
- EXECUTE upd;
+ --RAISE NOTICE 'Attempting to merge % %', table_name, cur_row.id;
+ EXECUTE upd || cur_row.id;
EXCEPTION WHEN unique_violation THEN
- -- RAISE NOTICE 'Deleting conflicting % %', table_name, cur_row.id;
- EXECUTE del;
+ --RAISE NOTICE 'Deleting conflicting % %', table_name, cur_row.id;
+ EXECUTE del || cur_row.id;
END;
END LOOP;
END;
More information about the open-ils-commits
mailing list