File: tables.sql

package info (click to toggle)
skytools 2.1.13-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,060 kB
  • sloc: sql: 6,723; python: 6,654; ansic: 2,841; makefile: 349; sh: 281
file content (48 lines) | stat: -rw-r--r-- 886 bytes parent folder | download | duplicates (2)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

set client_min_messages = 'warning';
set default_with_oids = 'off';

create schema pgq_ext;
grant usage on schema pgq_ext to public;


--
-- batch tracking
--
create table pgq_ext.completed_batch (
    consumer_id   text not null,
    last_batch_id bigint not null,

    primary key (consumer_id)
);


--
-- event tracking
--
create table pgq_ext.completed_event (
    consumer_id   text not null,
    batch_id      bigint not null,
    event_id      bigint not null,

    primary key (consumer_id, batch_id, event_id)
);

create table pgq_ext.partial_batch (
    consumer_id   text not null,
    cur_batch_id  bigint not null,

    primary key (consumer_id)
);

--
-- tick tracking for SerialConsumer()
-- no access functions provided here
--
create table pgq_ext.completed_tick (
    consumer_id   text not null,
    last_tick_id  bigint not null,

    primary key (consumer_id)
);