when no repositioning is needed, no need to panic
authorMarko Kreen <markokr@gmail.com>
Wed, 4 Apr 2007 14:27:29 +0000 (14:27 +0000)
committerMarko Kreen <markokr@gmail.com>
Wed, 4 Apr 2007 14:27:29 +0000 (14:27 +0000)
sql/pgq/functions/pgq.register_consumer.sql

index 7d387dab887bc6c4564d776196fc3c58debcdfd8..30d38792ab4891f31c1ef38babb897563101e9f0 100644 (file)
@@ -82,10 +82,10 @@ begin
         where sub_consumer = x_consumer_id
           and sub_queue  = x_queue_id;
     if found then
-        if sub.sub_batch is not null then
-            raise exception 'reposition while active not allowed';
-        end if;
         if x_tick_pos is not null then
+            if sub.sub_batch is not null then
+                raise exception 'reposition while active not allowed';
+            end if;
             -- update tick pos if requested
             update pgq.subscription
                 set sub_last_tick = x_tick_pos