DROP RESOURCE QUEUE

Delete the resource queue.

Summary

DROP RESOURCE QUEUE queue_name

describe

This command deletes the resource queue from the YMatrix database. To delete a resource queue, the queue cannot assign any roles, and there cannot be any waiting statements in the queue. Only superusers can delete resource queues.

Parameters

queue_name

  • The name of the resource queue to be deleted.

Note

Use ALTER ROLE to delete users from resource queues.

To view all currently active queries for all resource queues, perform the following query on the pg_locks table with the pg_roles and pg_resqueue tables:

SELECT rolname, rsqname, locktype, objid, pid,
mode, granted FROM pg_roles, pg_resqueue, pg_locks WHERE
pg_roles.rolresqueue=pg_locks.objid AND
pg_locks.objid=pg_resqueue.oid;

To view the roles assigned to the resource queue, perform the following query on the pg_roles and pg_resqueue system catalog tables:

SELECT rolname, rsqname FROM pg_roles, pg_resqueue WHERE
pg_roles.rolresqueue=pg_resqueue.oid;

Example

Remove the role from the resource queue (and move the role to the default resource queue pg_default):

ALTER ROLE bob RESOURCE QUEUE NONE;

Delete the resource queue named adhoc:

DROP RESOURCE QUEUE adhoc;

compatibility

The DROP RESOURCE QUEUE statement is a YMatrix database extension.

See also

ALTER RESOURCE QUEUE, CREATE RESOURCE QUEUE