diff options
author | Marko Kreen | 2009-04-08 13:03:56 +0000 |
---|---|---|
committer | Marko Kreen | 2009-04-08 14:11:09 +0000 |
commit | 0b975917317d799412067a063552d14bcc2268cd (patch) | |
tree | df83e7d7854d9306de3acb6eea79dbfdcde70514 | |
parent | 45bb93a4a2c18fefa789a5817a614712692d55fa (diff) |
sql/pgq: allow sub_last_tick to be NULL (pgq_coop)
-rw-r--r-- | sql/pgq/functions/pgq.get_consumer_info.sql | 8 | ||||
-rw-r--r-- | sql/pgq/structure/tables.sql | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sql/pgq/functions/pgq.get_consumer_info.sql b/sql/pgq/functions/pgq.get_consumer_info.sql index a101c9b3..6e0f92cd 100644 --- a/sql/pgq/functions/pgq.get_consumer_info.sql +++ b/sql/pgq/functions/pgq.get_consumer_info.sql @@ -103,10 +103,10 @@ begin current_timestamp - t.tick_time, current_timestamp - s.sub_active, s.sub_last_tick, s.sub_batch, s.sub_next_tick - from pgq.subscription s, pgq.tick t, pgq.queue q, pgq.consumer c - where t.tick_id = s.sub_last_tick - and q.queue_id = s.sub_queue - and t.tick_queue = s.sub_queue + from pgq.queue q, pgq.consumer c, + pgq.subscription s left join pgq.tick t + on (t.tick_queue = s.sub_queue and t.tick_id = s.sub_last_tick) + where q.queue_id = s.sub_queue and c.co_id = s.sub_consumer and (i_queue_name is null or q.queue_name = i_queue_name) and (i_consumer_name is null or c.co_name = i_consumer_name) diff --git a/sql/pgq/structure/tables.sql b/sql/pgq/structure/tables.sql index 6e88c7c5..041653cf 100644 --- a/sql/pgq/structure/tables.sql +++ b/sql/pgq/structure/tables.sql @@ -144,7 +144,7 @@ create table pgq.subscription ( sub_id serial not null, sub_queue int4 not null, sub_consumer int4 not null, - sub_last_tick bigint not null, + sub_last_tick bigint, sub_active timestamptz not null default now(), sub_batch bigint, sub_next_tick bigint, |