diff options
author | Marko Kreen | 2010-11-09 13:37:12 +0000 |
---|---|---|
committer | Marko Kreen | 2010-11-09 13:53:50 +0000 |
commit | 21f94957b356339a488b5c9bef53a60b3b3b69c5 (patch) | |
tree | 80571e91331e755842b16f3764db8d3497f4a91b | |
parent | ffc888c4c90f98551fdc2fd2b98f3ee1a8186d29 (diff) |
pgq.maint_rotate_tables: detect and report tick inconsistency
-rw-r--r-- | sql/pgq/functions/pgq.maint_rotate_tables.sql | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/pgq/functions/pgq.maint_rotate_tables.sql b/sql/pgq/functions/pgq.maint_rotate_tables.sql index b11ee510..4ac6e8f2 100644 --- a/sql/pgq/functions/pgq.maint_rotate_tables.sql +++ b/sql/pgq/functions/pgq.maint_rotate_tables.sql @@ -42,6 +42,9 @@ begin from pgq.tick where tick_queue = cf.queue_id and tick_id = lowest_tick_id; + if not found then + raise exception 'queue % maint failure: tick % not found', i_queue_name, lowest_tick_id; + end if; if lowest_xmin <= cf.queue_switch_step2 then return 0; -- skip rotation then end if; |