CREATE QUEUE v14
EDB Postgres Advanced Server includes extra syntax (not offered by Oracle) with the
CREATE QUEUE SQL command. This syntax can be used in association with
CREATE QUEUE -- create a queue.
CREATE QUEUE to define a new queue:
option_name and the corresponding
option_value can be:
CREATE QUEUE command allows a database superuser or any user with the system-defined
aq_administrator_role privilege to create a new queue in the current database.
If the name of the queue is schema-qualified, the queue is created in the specified schema. If a schema is not included in the
CREATE QUEUE command, the queue is created in the current schema. A queue may only be created in the schema in which the queue table resides. The name of the queue must be unique from the name of any other queue in the same schema.
DROP QUEUE to remove a queue.
The name (optionally schema-qualified) of the queue to be created.
The name of the queue table with which this queue is associated.
The name of any options that will be associated with the new queue, and the corresponding value for the option. If the call to
CREATE QUEUE includes duplicate option names, the server will return an error. The following values are accepted:
normal_queueto indicate that the queue is a normal queue, or
exception_queueto indicate that the queue is an exception queue. An exception queue will only accept dequeue operations.
INTEGERvalue that specifies the maximum number of attempts to remove a message from a queue.
DOUBLE PRECISIONvalue that specifies the number of seconds after a
ROLLBACKthat the server will wait before retrying a message.
DOUBLE PRECISIONvalue that specifies the number of seconds that a message will be saved in the queue table after dequeueing.
The following command creates a queue named
work_order that is associated with a queue table named
The server will allow 5 attempts to remove a message from the queue, and enforce a retry delay of 2 seconds between attempts.