<!--
doc/src/sgml/ref/drop_resource_queue.sgml
PostgreSQL documentation
-->

<refentry id="sql-dropresourcequeue">
 <indexterm zone="sql-dropresourcequeue">
  <primary>DROP RESOURCE QUEUE</primary>
 </indexterm>

 <refmeta>
  <refentrytitle>DROP RESOURCE QUEUE</refentrytitle>
  <manvolnum>7</manvolnum>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>DROP RESOURCE QUEUE</refname>
  <refpurpose>remove a resource queue</refpurpose>
 </refnamediv>

 <refsynopsisdiv>
<synopsis>
DROP RESOURCE QUEUE <replaceable class="PARAMETER">name</replaceable> [, ...]
</synopsis>
 </refsynopsisdiv>

 <refsect1>
  <title>Description</title>

  <para>
   <command>DROP RESOURCE QUEUE</command> removes the specified resource queue(s).
   You must be a superuser to drop a resource queue.
  </para>

  <para>
   A resource queue cannot be removed if it has any roles assigned to it
   or if it has any statements waiting in the queue.
  </para>

   </refsect1>

 <refsect1>
  <title>Parameters</title>

  <variablelist>
   <varlistentry>
    <term><replaceable class="PARAMETER">name</replaceable></term>
    <listitem>
     <para>
      The name of the resource queue to remove.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1>
  <title>Notes</title>

  <para>
   To see the roles assigned to a resource queue, query the 
   <literal>pg_roles</literal> and <literal>pg_resqueue</literal> 
   system catalog tables. To see if a resource queue has statements
   in it, query the <literal>pg_locks</literal> and <literal>pg_resqueue</literal> 
   system catalog tables.
  </para>

<para>
   Use <xref linkend="SQL-ALTERRESOURCEQUEUE" endterm="SQL-ALTERRESOURCEQUEUE-title"> to
   remove roles from a resource queue prior to dropping the queue.
  </para>

 </refsect1>

 <refsect1>
  <title>Examples</title>

  <para>
   To drop a resource queue:
<programlisting>
DROP RESOURCE QUEUE powerusers;
</programlisting>
  </para>

<para>
   To remove a role from a resource queue:
<programlisting>
ALTER ROLE RESOURCE QUEUE none;
</programlisting>
  </para>

 </refsect1>
 
 <refsect1>
  <title>Compatibility</title>
  
  <para>
   There is no <command>DROP RESOURCE QUEUE</command> in the SQL standard.
   Resource scheduling is a feature of Greenplum Database.
  </para>

 </refsect1>

 <refsect1>
  <title>See Also</title>

  <simplelist type="inline">
   <member><xref linkend="sql-alterrole" endterm="sql-alterrole"></member>
   <member><xref linkend="sql-createresourcequeue" endterm="sql-createresourcequeue-title"></member>
  <member><xref linkend="sql-alterresourcequeue" endterm="sql-alterresourcequeue-title"></member>
  </simplelist>
 </refsect1>

</refentry>
