duh, more missed fields
authorMarko Kreen <markokr@gmail.com>
Thu, 5 Apr 2007 09:49:36 +0000 (09:49 +0000)
committerMarko Kreen <markokr@gmail.com>
Thu, 5 Apr 2007 09:49:36 +0000 (09:49 +0000)
sql/pgq/functions/pgq.maint_rotate_tables.sql

index 0195b60520795c24e1322e46b5ff05fa0d59d7ce..f9d12367f887bdaf69d6c3b68d50d9281f2abcd4 100644 (file)
@@ -48,7 +48,7 @@ begin
     if nr = cf.queue_ntables then
         nr := 0;
     end if;
-    tbl := cf.table_name || '_' || nr;
+    tbl := cf.queue_data_pfx || '_' || nr;
 
     -- there may be long lock on the table from pg_dump,
     -- detect it and skip rotate then
@@ -72,7 +72,7 @@ begin
     -- clean ticks - avoid partial batches
     delete from pgq.tick
         where tick_queue = cf.queue_id
-          and get_snapshot_xmin(snapshot) < cf.last_switch_step2;
+          and get_snapshot_xmin(tick_snapshot) < cf.queue_switch_step2;
 
     return 1;
 end;