File: pgq_core_tx_limit.sql

package info (click to toggle)
pgq 3.2.6-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 836 kB
  • sloc: sql: 3,412; ansic: 1,990; python: 302; makefile: 89; sh: 2
file content (26 lines) | stat: -rw-r--r-- 872 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
\set VERBOSITY 'terse'
set client_min_messages = 'warning';

select pgq.create_queue('queue_tx_limit');

-- test limit
update pgq.queue set queue_per_tx_limit = 2 where queue_name = 'queue_tx_limit';
begin;
select pgq.insert_event('queue_tx_limit', 'test', 'event1');
select pgq.insert_event('queue_tx_limit', 'test', 'event2');
select pgq.insert_event('queue_tx_limit', 'test', 'event3');
end;

update pgq.queue set queue_per_tx_limit = 0 where queue_name = 'queue_tx_limit';
begin;
select pgq.insert_event('queue_tx_limit', 'test', 'event1');
end;

update pgq.queue set queue_per_tx_limit = null where queue_name = 'queue_tx_limit';
begin;
select pgq.insert_event('queue_tx_limit', 'test', 'event1');
select pgq.insert_event('queue_tx_limit', 'test', 'event2');
select pgq.insert_event('queue_tx_limit', 'test', 'event3');
end;

select pgq.drop_queue('queue_tx_limit');