File: pgq_session_role.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 (30 lines) | stat: -rw-r--r-- 1,169 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
27
28
29
30
\set VERBOSITY 'terse'
set client_min_messages = 'warning';

show session_replication_role;

select pgq.create_queue('role_test_enabled');
select pgq.create_queue('role_test_disabled');
update pgq.queue set queue_disable_insert=true where queue_name = 'role_test_disabled';

select pgq.insert_event('role_test_enabled', 'enabled', 'role:origin');
select pgq.insert_event('role_test_disabled', 'disabled', 'role:origin');

set session_replication_role = 'replica';
show session_replication_role;
select pgq.insert_event('role_test_enabled', 'enabled', 'role:replica');
select pgq.insert_event('role_test_disabled', 'disabled', 'role:replica');

set session_replication_role = 'local';
show session_replication_role;
select pgq.insert_event('role_test_enabled', 'enabled', 'role:local');
select pgq.insert_event('role_test_disabled', 'disabled', 'role:local');

set session_replication_role = 'origin';
show session_replication_role;
select pgq.insert_event('role_test_enabled', 'enabled', 'role:origin');
select pgq.insert_event('role_test_disabled', 'disabled', 'role:origin');

select pgq.drop_queue('role_test_enabled');
select pgq.drop_queue('role_test_disabled');