Index

M |
| maint_operations(0), pgq
| maint_retry_events(0), pgq
| maint_rotate_tables_step1(1), pgq
| maint_rotate_tables_step2(0), pgq
| maint_tables_to_vacuum(0), pgq
N |
| next_batch(2), pgq
| next_batch_custom(5), pgq
| next_batch_info(2), pgq
P |
| Periodic maintenence
| pgq.consumer
| pgq.event_template
| pgq.queue
| pgq.retry_queue
| pgq.subscription
| pgq.tick
| Public Functions
| Public Triggers
Q |
| Queue creation
| quote_fqname(1), pgq
R |
| Random utility functions
| register_consumer(2), pgq
| register_consumer_at(3), pgq
S |
| seq_getval(1), pgq
| seq_setval(2), pgq
| set_queue_config(3), pgq
| sqltriga, pgq
| Subscribing to queue
T |
| Ticker
| ticker(0), pgq
| ticker(1), pgq
| ticker(3), pgq
| Trigger Functions
| tune_storage(1), pgq
U |
| unregister_consumer(2), pgq
V |
| version(0), pgq

> pgq.maint_operations( | out | func_name | text,
> | out | func_arg | text | ) returns setof record

Returns list of functions to call for maintenance.

> pgq.maint_retry_events() returns integer

Moves retry events back to main queue.

> pgq.maint_rotate_tables_step1( | i_queue_name | text | ) returns integer

Rotate tables for one queue.

> pgq.maint_rotate_tables_step2() returns integer

Stores the txid when the rotation was visible.

> pgq.maint_tables_to_vacuum() returns setof text

Returns list of tablenames that need frequent vacuuming.

> pgq.next_batch( | in | i_queue_name | text,
> | in | i_consumer_name | text | ) returns int8

Old function that returns just batch_id.

> pgq.next_batch_custom( | in | i_queue_name | text,
> | in | i_consumer_name | text,
> | in | i_min_lag | interval,
> | in | i_min_count | int4,
> | in | i_min_interval | interval,
> | out | batch_id | int8,
> | out | cur_tick_id | int8,
> | out | prev_tick_id | int8,
> | out | cur_tick_time | timestamptz,
> | out | prev_tick_time | timestamptz,
> | out | cur_tick_event_seq | int8,
> | out | prev_tick_event_seq | int8 | ) as

Makes next block of events active.

> pgq.next_batch_info( | in | i_queue_name | text,
> | in | i_consumer_name | text,
> | out | batch_id | int8,
> | out | cur_tick_id | int8,
> | out | prev_tick_id | int8,
> | out | cur_tick_time | timestamptz,
> | out | prev_tick_time | timestamptz,
> | out | cur_tick_event_seq | int8,
> | out | prev_tick_event_seq | int8 | ) as

Makes next block of events active.
Name to id lookup for consumers
Parent table for all event tables
Information about available queues
Events to be retried.
Consumer registration on a queue.
Snapshots for event batching
The queue is used by a client in the following steps

> pgq.quote_fqname( | i_name | text | ) returns text

Quete fully-qualified object name for SQL.

> pgq.register_consumer( | x_queue_name | text,
> | x_consumer_id | text | ) returns integer

Subscribe consumer on a queue.

> pgq.register_consumer_at( | x_queue_name | text,
> | x_consumer_name | text,
> | x_tick_pos | bigint | ) returns integer

Extended registration, allows to specify tick_id.

> pgq.seq_getval( | i_seq_name | text | ) returns bigint

Read current last_val from seq, without affecting it.

> pgq.seq_setval( | i_seq_name | text,
> | i_new_value | int8 | ) returns bigint

Like setval() but does not allow going back.

> pgq.set_queue_config( | x_queue_name | text,
> | x_param_name | text,
> | x_param_value | text | ) returns integer

Set configuration for specified queue.

> pgq.sqltriga() RETURNS trigger AS

Trigger that generates queue events containing partial SQL.

> pgq.ticker() returns bigint

Creates ticks for all unpaused queues which dont have external ticker.

> pgq.ticker( | i_queue_name | text | ) returns bigint

Check if tick is needed for the queue and insert it.

> pgq.ticker( | i_queue_name | text,
> | i_tick_id | bigint,
> | i_orig_timestamp | timestamptz,
> | i_event_seq | bigint | ) returns bigint

External ticker: Insert a tick with a particular tick_id and timestamp.

> pgq.tune_storage( | i_queue_name | text | ) returns integer

Tunes storage settings for queue data tables

> pgq.unregister_consumer( | x_queue_name | text,
> | x_consumer_name | text | ) returns integer

Unsubscribe consumer from the queue.

> pgq.version() returns text

Returns version string for pgq.
Close