[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Call for testing experimental patch



On Mon, 2006-09-11 at 22:49 -0700, Chris Travers wrote:
> This patch will hopefully get included with the next version but I
> want to put it through some more vetting first.  I am testing it on my
> production machines.
> 
> What it does is install a shadow table with a primary key index which
> ensures that transaciton id's are unique across tables.  I see no
> concerns about integrity of production data.
> 
> Ideas and feedback are welcome.

I've found a few problems with the script as posted attached is a patch
to fix what I can see right off.

-- 
Tony Fraser
..hidden..
Sybaspace Internet Solutions                        System Administrator
phone: (250) 246-5368                                fax: (250) 246-5398
--- unique_trans_id.sql	2006-09-12 14:49:07.676275312 -0700
+++ unique_trans_id.sql.new	2006-09-12 15:04:35.715191952 -0700
@@ -13,6 +13,14 @@
 CREATE RULE ap_id_track_u AS ON update TO ap 
 DO ALSO UPDATE id_tracker SET id = new.id WHERE id = old.id;
 
+insert into id_tracker (id, table_name) SELECT id, 'ar' FROM ar;
+
+CREATE RULE ar_id_track_i AS ON insert TO ar 
+DO ALSO INSERT INTO id_tracker (id, table_name) VALUES (new.id, 'ar');
+
+CREATE RULE ar_id_track_u AS ON update TO ar 
+DO ALSO UPDATE id_tracker SET id = new.id WHERE id = old.id;
+
 INSERT INTO id_tracker (id, table_name) SELECT id, 'business' FROM business;
 
 CREATE RULE business_id_track_i AS ON insert TO business 
@@ -95,7 +103,7 @@
 
 INSERT INTO id_tracker (id, table_name) SELECT id, 'project' FROM project;
 
-CREATE RULE project_id_track_i AS ON insert TO chart 
+CREATE RULE project_id_track_i AS ON insert TO project 
 DO ALSO INSERT INTO id_tracker (id, table_name) VALUES (new.id, 'project');
 
 CREATE RULE project_id_track_u AS ON update TO project