<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_type.sgml,v 1.7 2000/07/22 04:30:27 momjian Exp $
Postgres documentation
-->

<refentry id="SQL-DROPTYPE">
 <refmeta>
  <refentrytitle id="SQL-DROPTYPE-TITLE">
   DROP TYPE
  </refentrytitle>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>
 <refnamediv>
  <refname>
   DROP TYPE
  </refname>
  <refpurpose>
   Removes a user-defined type from the system catalogs
  </refpurpose>
 </refnamediv>
 <refsynopsisdiv>
  <refsynopsisdivinfo>
   <date>1999-07-20</date>
  </refsynopsisdivinfo>
  <synopsis>
DROP TYPE <replaceable class="PARAMETER">typename</replaceable>
  </synopsis>
  
  <refsect2 id="R2-SQL-DROPTYPE-1">
   <refsect2info>
    <date>1998-09-22</date>
   </refsect2info>
   <title>
    Inputs
   </title>
   <para>
    <variablelist>
     <varlistentry>
      <term><replaceable class="PARAMETER">typename</replaceable></term>
      <listitem>
       <para>
	The name of an existing type.
       </para>
      </listitem>
     </varlistentry>
    </variablelist>
   </para>
  </refsect2>

  <refsect2 id="R2-SQL-DROPTYPE-2">
   <refsect2info>
    <date>1998-09-22</date>
   </refsect2info>
   <title>
    Outputs
   </title>
   <para>
    <variablelist>
     <varlistentry>
      <term><computeroutput>
DROP
       </computeroutput></term>
      <listitem>
       <para>
	The message returned if the command is successful.
       </para>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term><computeroutput>
ERROR:  RemoveType: type '<replaceable class="parameter">typename</replaceable>' does not exist
       </computeroutput></term>
      <listitem>
       <para>
	This message occurs if the specified type is not found.
       </para>
      </listitem>
     </varlistentry>
    </variablelist>
   </para>
  </refsect2>
 </refsynopsisdiv>

 <refsect1 id="R1-SQL-DROPTYPE-1">
  <refsect1info>
   <date>1998-09-22</date>
  </refsect1info>
  <title>
   Description
  </title>
  <para>
   <command>DROP TYPE</command> will remove a user type from the
   system catalogs.
  </para>
  <para>
   Only the owner of a type can remove it.
  </para>

  <refsect2 id="R2-SQL-DROPTYPE-3">
   <refsect2info>
    <date>1998-09-22</date>
   </refsect2info>
   <title>
    Notes
   </title>
   <para>
    DROP TYPE statement is a <productname>Postgres</productname>
    language extension.
   </para>
   <para>
    Refer to <command>CREATE TYPE</command> for
    information on how to create types.
   </para>
   <para>
    It is the user's responsibility to remove any operators,
    functions, aggregates, access methods, subtypes, and classes
    that use a deleted type.
   </para>

   <para>
    If a built-in type is removed, the behavior of the backend
    is unpredictable.
   </para>
  </refsect2>
 </refsect1>
  
 <refsect1 id="R1-SQL-DROPTYPE-2">
  <title>
   Usage
  </title>
  <para>
   To remove the <literal>box</literal> type:

   <programlisting>
DROP TYPE box;
   </programlisting>
  </para>
 </refsect1>

 <refsect1 id="R1-SQL-DROPTYPE-3">
  <title>
   Compatibility
  </title>
  
  <refsect2 id="R2-SQL-DROPTYPE-5">
   <refsect2info>
    <date>1998-09-22</date>
   </refsect2info>
   <title>
    SQL3
   </title>
   <para>
    <command>DROP TYPE</command> is a <acronym>SQL3</acronym> statement.
   </para>
  </refsect2>
 </refsect1>
</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:nil
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../reference.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:"/usr/lib/sgml/catalog"
sgml-local-ecat-files:nil
End:
-->
