DROP RESOURCE QUEUE

Removes a resource queue.

Synopsis

  1. DROP RESOURCE QUEUE <queue_name>

Description

This command removes a resource queue from HAWQ. To drop a resource queue, the queue cannot have any roles assigned to it, nor can it have any statements waiting in the queue or have any children resource queues. Only a superuser can drop a resource queue.

Note: The pg_root and pg_default resource queues cannot be dropped.

Parameters

<queue_name>

The name of a resource queue to remove.

Notes

Use ALTER ROLE to remove a user from a resource queue.

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

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

To see the roles assigned to a resource queue, perform the following query of the pg_roles and pg_resqueue system catalog tables:

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

Examples

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

  1. ALTER ROLE bob RESOURCE QUEUE NONE;

Remove the resource queue named adhoc:

  1. DROP RESOURCE QUEUE adhoc;

Compatibility

The DROP RESOURCE QUEUE statement is a HAWQ extension.

See Also

CREATE RESOURCE QUEUE, ALTER ROLE, ALTER RESOURCE QUEUE