head	1.29;
access;
symbols
	REL9_0_0:1.29
	REL9_1_ALPHA1:1.29
	REL9_0_RC1:1.29
	REL9_0_BETA4:1.29
	REL9_0_STABLE:1.29.0.2
	REL9_0_BETA3:1.29
	REL9_0_BETA2:1.29
	REL7_4_29:1.20
	REL8_0_25:1.22
	REL8_1_21:1.22
	REL8_2_17:1.25
	REL8_3_11:1.27
	REL8_4_4:1.28
	REL9_0_BETA1:1.29
	REL9_0_ALPHA5_BRANCH:1.28.0.12
	REL9_0_ALPHA5:1.28
	REL7_4_28:1.20
	REL8_0_24:1.22
	REL8_1_20:1.22
	REL8_2_16:1.25
	REL8_3_10:1.27
	REL8_4_3:1.28
	REL9_0_ALPHA4:1.28
	REL9_0_ALPHA4_BRANCH:1.28.0.10
	REL8_5_ALPHA3:1.28
	REL8_5_ALPHA3_BRANCH:1.28.0.8
	REL7_4_27:1.20
	REL8_0_23:1.22
	REL8_1_19:1.22
	REL8_2_15:1.25
	REL8_3_9:1.27
	REL8_4_2:1.28
	REL8_5_ALPHA2:1.28
	REL8_5_ALPHA2_BRANCH:1.28.0.6
	REL7_4_26:1.20
	REL8_0_22:1.22
	REL8_1_18:1.22
	REL8_2_14:1.25
	REL8_3_8:1.27
	REL8_4_1:1.28
	REL8_5_ALPHA1:1.28
	REL8_5_ALPHA1_BRANCH:1.28.0.4
	REL8_4_STABLE:1.28.0.2
	REL8_4_0:1.28
	REL8_4_RC2:1.28
	REL8_4_RC1:1.28
	REL8_4_BETA2:1.28
	REL8_4_BETA1:1.28
	REL7_4_25:1.20
	REL8_0_21:1.22
	REL8_1_17:1.22
	REL8_2_13:1.25
	REL8_3_7:1.27
	REL7_4_24:1.20
	REL8_0_20:1.22
	REL8_1_16:1.22
	REL8_2_12:1.25
	REL8_3_6:1.27
	REL7_4_23:1.20
	REL8_0_19:1.22
	REL8_1_15:1.22
	REL8_2_11:1.25
	REL8_3_5:1.27
	REL7_4_22:1.20
	REL8_0_18:1.22
	REL8_1_14:1.22
	REL8_2_10:1.25
	REL8_3_4:1.27
	REL7_4_21:1.20
	REL8_0_17:1.22
	REL8_1_13:1.22
	REL8_2_9:1.25
	REL8_3_3:1.27
	REL7_4_20:1.20
	REL8_0_16:1.22
	REL8_1_12:1.22
	REL8_2_8:1.25
	REL8_3_2:1.27
	REL8_2_7:1.25
	REL8_3_1:1.27
	REL8_3_STABLE:1.27.0.2
	REL8_3_0:1.27
	REL8_3_RC2:1.27
	REL7_3_21:1.17
	REL7_4_19:1.20
	REL8_0_15:1.22
	REL8_1_11:1.22
	REL8_2_6:1.25
	REL8_3_RC1:1.27
	REL8_3_BETA4:1.27
	REL8_3_BETA3:1.27
	REL8_3_BETA2:1.27
	REL8_3_BETA1:1.27
	REL7_3_20:1.17
	REL7_4_18:1.20
	REL8_0_14:1.22
	REL8_1_10:1.22
	REL8_2_5:1.25
	REL7_3_19:1.17
	REL7_4_17:1.20
	REL8_0_13:1.22
	REL8_1_9:1.22
	REL8_2_4:1.25
	REL8_0_12:1.22
	REL8_1_8:1.22
	REL8_2_3:1.25
	REL7_3_18:1.17
	REL7_4_16:1.20
	REL8_0_11:1.22
	REL8_1_7:1.22
	REL8_2_2:1.25
	REL8_0_10:1.22
	REL8_1_6:1.22
	REL8_2_1:1.25
	REL7_4_15:1.20
	REL7_3_17:1.17
	REL8_2_STABLE:1.25.0.2
	REL8_2_0:1.25
	REL8_2_RC1:1.25
	REL8_2_BETA3:1.25
	REL8_2_BETA2:1.25
	REL8_1_5:1.22
	REL8_0_9:1.22
	REL7_4_14:1.20
	REL7_3_16:1.17
	REL8_2_BETA1:1.25
	REL7_3_15:1.17
	REL7_4_13:1.20
	REL8_0_8:1.22
	REL8_1_4:1.22
	REL7_3_14:1.17
	REL7_4_12:1.20
	REL8_0_7:1.22
	REL8_1_3:1.22
	REL7_3_13:1.17
	REL7_4_11:1.20
	REL8_0_6:1.22
	REL8_1_2:1.22
	REL7_3_12:1.17
	REL7_4_10:1.20
	REL8_0_5:1.22
	REL8_1_1:1.22
	REL8_1_STABLE:1.22.0.6
	REL8_1_0:1.22
	REL8_1_0RC1:1.22
	REL8_1_0BETA4:1.22
	REL8_1_0BETA3:1.22
	REL7_3_11:1.17
	REL7_4_9:1.20
	REL8_0_4:1.22
	REL8_1_0BETA2:1.22
	REL8_1_0BETA1:1.22
	REL7_2_8:1.12
	REL7_3_10:1.17
	REL7_4_8:1.20
	REL8_0_3:1.22
	REL8_0_2:1.22
	REL7_2_7:1.12
	REL7_3_9:1.17
	REL7_4_7:1.20
	REL8_0_1:1.22
	REL8_0_STABLE:1.22.0.4
	REL8_0_0:1.22.0.2
	REL8_0_0RC5:1.22
	REL8_0_0RC4:1.22
	REL8_0_0RC3:1.21
	REL8_0_0RC2:1.21
	REL8_0_0RC1:1.21
	REL8_0_0BETA5:1.21
	REL8_0_0BETA4:1.21
	REL7_4_6:1.20
	REL7_3_8:1.17
	REL7_2_6:1.12
	REL8_0_0BETA3:1.21
	REL8_0_0BETA2:1.21
	REL7_2_5:1.12
	REL7_4_5:1.20
	REL7_3_7:1.17
	REL7_4_4:1.20
	REL8_0_0BETA1:1.21
	REL7_4_3:1.20
	REL7_4_2:1.20
	REL7_3_6:1.17
	REL7_4_1:1.20
	REL7_3_5:1.17
	REL7_4:1.20
	REL7_4_RC2:1.20
	REL7_4_STABLE:1.20.0.2
	REL7_4_RC1:1.20
	REL7_4_BETA5:1.20
	REL7_4_BETA4:1.20
	REL7_4_BETA3:1.20
	REL7_4_BETA2:1.18
	WIN32_DEV:1.18.0.2
	REL7_4_BETA1:1.18
	REL7_3_4:1.17
	REL7_3_2:1.17
	REL7_2_4:1.12
	REL7_3_STABLE:1.17.0.2
	REL7_2_3:1.12
	REL7_2_STABLE:1.12.0.2
	REL7_2:1.12
	REL7_2_RC2:1.12
	REL7_2_RC1:1.12
	REL7_2_BETA5:1.12
	REL7_2_BETA4:1.12
	REL7_2_BETA3:1.11
	REL7_2_BETA2:1.11
	REL7_2_BETA1:1.11
	REL7_1_2:1.9
	REL7_1_STABLE:1.9.0.2
	REL7_1_BETA:1.9
	REL7_1_BETA3:1.9
	REL7_1_BETA2:1.9
	REL7_1:1.9
	REL7_0_PATCHES:1.6.0.2
	REL7_0:1.6
	REL6_5_PATCHES:1.5.0.2
	REL6_5:1.5
	REL6_4:1.3.0.2;
locks; strict;
comment	@# @;


1.29
date	2010.04.03.07.23.01;	author petere;	state Exp;
branches;
next	1.28;

1.28
date	2008.11.14.10.22.46;	author petere;	state Exp;
branches;
next	1.27;

1.27
date	2007.05.15.19.13.55;	author neilc;	state Exp;
branches;
next	1.26;

1.26
date	2007.01.31.23.26.03;	author momjian;	state Exp;
branches;
next	1.25;

1.25
date	2006.09.16.00.30.18;	author momjian;	state Exp;
branches;
next	1.24;

1.24
date	2006.04.02.03.56.40;	author neilc;	state Exp;
branches;
next	1.23;

1.23
date	2005.11.19.17.39.44;	author adunstan;	state Exp;
branches;
next	1.22;

1.22
date	2005.01.04.00.39.53;	author tgl;	state Exp;
branches;
next	1.21;

1.21
date	2003.11.29.19.51.38;	author pgsql;	state Exp;
branches;
next	1.20;

1.20
date	2003.09.09.18.28.53;	author tgl;	state Exp;
branches;
next	1.19;

1.19
date	2003.08.31.17.32.23;	author petere;	state Exp;
branches;
next	1.18;

1.18
date	2003.05.04.02.23.16;	author petere;	state Exp;
branches
	1.18.2.1;
next	1.17;

1.17
date	2002.07.14.22.47.56;	author tgl;	state Exp;
branches;
next	1.16;

1.16
date	2002.07.12.18.43.13;	author tgl;	state Exp;
branches;
next	1.15;

1.15
date	2002.05.18.15.44.47;	author petere;	state Exp;
branches;
next	1.14;

1.14
date	2002.04.23.02.07.16;	author tgl;	state Exp;
branches;
next	1.13;

1.13
date	2002.04.21.19.02.39;	author thomas;	state Exp;
branches;
next	1.12;

1.12
date	2001.12.08.03.24.36;	author thomas;	state Exp;
branches;
next	1.11;

1.11
date	2001.09.03.12.57.49;	author petere;	state Exp;
branches;
next	1.10;

1.10
date	2001.08.13.15.24.46;	author momjian;	state Exp;
branches;
next	1.9;

1.9
date	2000.10.22.23.32.38;	author tgl;	state Exp;
branches;
next	1.8;

1.8
date	2000.10.18.16.16.03;	author momjian;	state Exp;
branches;
next	1.7;

1.7
date	2000.07.21.04.37.10;	author momjian;	state Exp;
branches;
next	1.6;

1.6
date	99.07.22.15.09.11;	author thomas;	state Exp;
branches;
next	1.5;

1.5
date	99.07.06.17.16.38;	author thomas;	state Exp;
branches;
next	1.4;

1.4
date	98.12.29.02.24.40;	author thomas;	state Exp;
branches;
next	1.3;

1.3
date	98.10.30.19.34.15;	author thomas;	state Exp;
branches;
next	1.2;

1.2
date	98.09.22.15.47.59;	author thomas;	state Exp;
branches;
next	1.1;

1.1
date	98.09.07.15.53.11;	author thomas;	state Exp;
branches;
next	;

1.18.2.1
date	2003.09.07.04.36.45;	author momjian;	state Exp;
branches;
next	;


desc
@@


1.29
log
@Remove unnecessary xref endterm attributes and title ids

The endterm attribute is mainly useful when the toolchain does not support
automatic link target text generation for a particular situation.  In  the
past, this was required by the man page tools for all reference page links,
but that is no longer the case, and it now actually gets in the way of
proper automatic link text generation.  The only remaining use cases are
currently xrefs to refsects.
@
text
@<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/drop_table.sgml,v 1.28 2008/11/14 10:22:46 petere Exp $
PostgreSQL documentation
-->

<refentry id="SQL-DROPTABLE">
 <refmeta>
  <refentrytitle>DROP TABLE</refentrytitle>
  <manvolnum>7</manvolnum>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>DROP TABLE</refname>
  <refpurpose>remove a table</refpurpose>
 </refnamediv>

 <indexterm zone="sql-droptable">
  <primary>DROP TABLE</primary>
 </indexterm>

 <refsynopsisdiv>
<synopsis>
DROP TABLE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> [, ...] [ CASCADE | RESTRICT ]
</synopsis>
 </refsynopsisdiv>
 
 <refsect1>
  <title>Description</title>

  <para>
   <command>DROP TABLE</command> removes tables from the database.
   Only its owner can drop a table.  To empty a table of rows
   without destroying the table, use <xref linkend="sql-delete">
   or <xref linkend="sql-truncate">.
  </para>

  <para>
   <command>DROP TABLE</command> always removes any indexes, rules,
   triggers, and constraints that exist for the target table.
   However, to drop a table that is referenced by a view or a foreign-key
   constraint of another table, <literal>CASCADE</> must be
   specified. (<literal>CASCADE</> will remove a dependent view entirely,
   but in the foreign-key case it will only remove the foreign-key
   constraint, not the other table entirely.)
  </para>
 </refsect1>
  
 <refsect1>
  <title>Parameters</title>

  <variablelist>
   <varlistentry>
    <term><literal>IF EXISTS</literal></term>
    <listitem>
     <para>
      Do not throw an error if the table does not exist. A notice is issued 
      in this case.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="PARAMETER">name</replaceable></term>
    <listitem>
     <para>
      The name (optionally schema-qualified) of the table to drop.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>CASCADE</literal></term>
    <listitem>
     <para>
      Automatically drop objects that depend on the table (such as
      views).
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>RESTRICT</literal></term>
    <listitem>
     <para>
      Refuse to drop the table if any objects depend on it.  This is
      the default.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1>
  <title>Examples</title>

  <para>
   To destroy two tables, <literal>films</literal> and 
   <literal>distributors</literal>:

<programlisting>
DROP TABLE films, distributors;
</programlisting>
  </para>
 </refsect1>
 
 <refsect1>
  <title>Compatibility</title>

  <para>
   This command conforms to the SQL standard, except that the standard only
   allows one table to be dropped per command, and apart from the 
   <literal>IF EXISTS</> option, which is a <productname>PostgreSQL</> 
   extension.
  </para>
 </refsect1>

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

  <simplelist type="inline">
   <member><xref linkend="sql-altertable"></member>
   <member><xref linkend="sql-createtable"></member>
  </simplelist>
 </refsect1>

</refentry>
@


1.28
log
@Set SQL man pages to be section 7 by default, and only transform them to
another section if required by the platform (instead of the old way of
building them in section "l" and always transforming them to the
platform-specific section).

This speeds up the installation on common platforms, and it avoids some
funny business with the man page tools and build process.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/drop_table.sgml,v 1.27 2007/05/15 19:13:55 neilc Exp $
d8 1
a8 1
  <refentrytitle id="SQL-DROPTABLE-TITLE">DROP TABLE</refentrytitle>
d34 2
a35 3
   without destroying the table, use <xref linkend="sql-delete"
   endterm="sql-delete-title"> or <xref linkend="sql-truncate"
   endterm="sql-truncate-title">.
d122 2
a123 2
   <member><xref linkend="sql-altertable" endterm="sql-altertable-title"></member>
   <member><xref linkend="sql-createtable" endterm="sql-createtable-title"></member>
@


1.27
log
@Various fixes for the SGML docs. Consistently use spaces before/after
parentheses in syntax descriptions. Consistently use the present tense
when describing the basic purpose of each "DROP" command. Add a few
more hyperlinks.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/drop_table.sgml,v 1.26 2007/01/31 23:26:03 momjian Exp $
d9 1
@


1.26
log
@Update reference documentation on may/can/might:

Standard English uses "may", "can", and "might" in different ways:

        may - permission, "You may borrow my rake."

        can - ability, "I can lift that log."

        might - possibility, "It might rain today."

Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice.  Similarly, "It may crash" is better stated, "It might crash".
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/drop_table.sgml,v 1.25 2006/09/16 00:30:18 momjian Exp $
d32 1
a32 1
   Only its owner can destroy a table.  To empty a table of rows
@


1.25
log
@Remove emacs info from footer of SGML files.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/drop_table.sgml,v 1.24 2006/04/02 03:56:40 neilc Exp $
d32 1
a32 1
   Only its owner may destroy a table.  To empty a table of rows
@


1.24
log
@Minor improvement to DROP TABLE reference page.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/drop_table.sgml,v 1.23 2005/11/19 17:39:44 adunstan Exp $
a127 17

<!-- 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:
-->
@


1.23
log
@
DROP objecttype IF EXISTS for the following objects:
  table view index sequence schema type domain conversion
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/drop_table.sgml,v 1.22 2005/01/04 00:39:53 tgl Exp $
d32 4
a35 2
   Only its owner may destroy a table.  To empty a table of rows,
   without destroying the table, use <command>DELETE</command>.
@


1.22
log
@More minor updates and copy-editing.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/drop_table.sgml,v 1.21 2003/11/29 19:51:38 pgsql Exp $
d23 1
a23 1
DROP TABLE <replaceable class="PARAMETER">name</replaceable> [, ...] [ CASCADE | RESTRICT ]
d52 10
d110 3
a112 1
   allows one table to be dropped per command. 
@


1.21
log
@
$Header: -> $PostgreSQL Changes ...
@
text
@d2 1
a2 1
$PostgreSQL: /cvsroot/pgsql-server/doc/src/sgml/ref/drop_table.sgml,v 1.20 2003/09/09 18:28:53 tgl Exp $
d39 1
a39 1
   However, to drop a table that is referenced by a foreign-key
d41 2
a42 1
   specified. (<literal>CASCADE</> will remove the foreign-key
d99 2
a100 1
   This command conforms to the SQL standard.
@


1.20
log
@Remove a bunch of content-free Diagnostics sections, as per previous
discussion.  (Still have some work to do editing the remainder.)
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/drop_table.sgml,v 1.19 2003/08/31 17:32:23 petere Exp $
@


1.19
log
@Add/edit index entries.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/drop_table.sgml,v 1.18 2003/05/04 02:23:16 petere Exp $
a74 24
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1>
  <title>Diagnostics</title>

  <variablelist>
   <varlistentry>
    <term><computeroutput>DROP TABLE</computeroutput></term>
    <listitem>
     <para>
      Message returned if the command completes successfully.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><computeroutput>ERROR: table "<replaceable class="parameter">name</replaceable>" does not exist</computeroutput></term>
    <listitem>
     <para>
      Message returned if the specified table does not exist.
@


1.18
log
@Last round of reference page editing.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/drop_table.sgml,v 1.17 2002/07/14 22:47:56 tgl Exp $
d16 4
@


1.18.2.1
log
@Update this branch to match CVS head, includes WIN32 improvements.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/drop_table.sgml,v 1.19 2003/08/31 17:32:23 petere Exp $
a15 4

 <indexterm zone="sql-droptable">
  <primary>DROP TABLE</primary>
 </indexterm>
@


1.17
log
@Remove no-longer-appropriate notes about lack of CASCADE/RESTRICT behavior.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_table.sgml,v 1.16 2002/07/12 18:43:13 tgl Exp $
d11 1
d13 2
a14 6
  <refname>
   DROP TABLE
  </refname>
  <refpurpose>
   remove a table
  </refpurpose>
d16 1
d18 1
a18 4
  <refsynopsisdivinfo>
   <date>1999-07-20</date>
  </refsynopsisdivinfo>
  <synopsis>
d20 1
a20 74

  </synopsis>
  
  <refsect2 id="R2-SQL-DROPTABLE-1">
   <refsect2info>
    <date>1998-09-22</date>
   </refsect2info>
   <title>
    Inputs
   </title>
   <para>
    <variablelist>
     <varlistentry>
      <term><replaceable class="PARAMETER">name</replaceable></term>
      <listitem>
       <para>
	The name (optionally schema-qualified) of an existing table to drop.
       </para>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term>CASCADE</term>
      <listitem>
       <para>
        Automatically drop objects that depend on the table
	(such as views).
       </para>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term>RESTRICT</term>
      <listitem>
       <para>
        Refuse to drop the table if there are any dependent objects.
	This is the default.
       </para>
      </listitem>
     </varlistentry>
    </variablelist>
   </para>
  </refsect2>

  <refsect2 id="R2-SQL-DROPTABLE-2">
   <refsect2info>
    <date>1998-09-22</date>
   </refsect2info>
   <title>
    Outputs
   </title>
   <para>
    <variablelist>
     <varlistentry>
      <term><computeroutput>
DROP TABLE
       </computeroutput></term>
      <listitem>
       <para>
	The message returned if the command completes successfully.
       </para>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term><computeroutput>
ERROR: table "<replaceable class="parameter">name</replaceable>" does not exist
       </computeroutput></term>
      <listitem>
       <para>
	If the specified table does not exist in the database.
       </para>
      </listitem>
     </varlistentry>
    </variablelist>
   </para>
  </refsect2>
d23 3
a25 7
 <refsect1 id="R1-SQL-DROPTABLE-1">
  <refsect1info>
   <date>1998-09-22</date>
  </refsect1info>
  <title>
   Description
  </title>
d28 2
a29 2
   Only its owner may destroy a table. A table may be emptied of rows, but not
   destroyed, by using <command>DELETE</command>.
d31 1
d34 5
a38 4
   triggers, and constraints that exist for the target table.  However,
   to drop a table that is referenced by a foreign-key constraint of another
   table, CASCADE must be specified. (CASCADE will remove the foreign-key
   constraint, not the other table itself.)
d40 63
a103 19
  <refsect2 id="R2-SQL-DROPTABLE-3">
   <refsect2info>
    <date>1998-09-22</date>
   </refsect2info>
   <title>
    Notes
   </title>
   <para>
    Refer to <command>CREATE TABLE</command> and
    <command>ALTER TABLE</command> for information on
    how to create or modify tables.
   </para>
  </refsect2>
 </refsect1>

 <refsect1 id="R1-SQL-DROPTABLE-2">
  <title>
   Usage
  </title>
d108 1
a108 1
   <programlisting>
d110 1
a110 1
   </programlisting>
d114 15
a128 12
 <refsect1 id="R1-SQL-DROPTABLE-3">
   <title>
   Compatibility
  </title>
  
  <refsect2 id="R2-SQL-DROPTABLE-4">
   <title>
    SQL92
   </title>
   <para>
   </para>
   </refsect2>
d130 1
@


1.16
log
@Second phase of committing Rod Taylor's pg_depend/pg_constraint patch.
pg_relcheck is gone; CHECK, UNIQUE, PRIMARY KEY, and FOREIGN KEY
constraints all have real live entries in pg_constraint.  pg_depend
exists, and RESTRICT/CASCADE options work on most kinds of DROP;
however, pg_depend is not yet very well populated with dependencies.
(Most of the ones that are present at this point just replace formerly
hardwired associations, such as the implicit drop of a relation's pg_type
entry when the relation is dropped.)  Need to add more logic to create
dependency entries, improve pg_dump to dump constraints in place of
indexes and triggers, and add some regression tests.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_table.sgml,v 1.15 2002/05/18 15:44:47 petere Exp $
d114 5
a118 7
   If a table being destroyed has secondary indexes on it,
   they will be removed first. The removal of just a
   secondary index will not affect the contents of the underlying table.
  </para>
  <para>
   <command>DROP TABLE</command> will also remove any rules or triggers
   that exist for the target table.
@


1.15
log
@Revise command completion tags as per hackers message on 20 March.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_table.sgml,v 1.14 2002/04/23 02:07:16 tgl Exp $
d24 2
a25 1
DROP TABLE <replaceable class="PARAMETER">name</replaceable> [, ...]
d45 18
a157 3
   <refsect2info>
    <date>1998-09-22</date>
   </refsect2info>
a161 1
    SQL92 specifies some additional capabilities for DROP TABLE:
a162 29
   <synopsis>
DROP TABLE <replaceable class="parameter">table</replaceable> { RESTRICT | CASCADE }
   </synopsis>
   <variablelist>
    <varlistentry>
     <term>RESTRICT</term>
     <listitem>
      <para>
       Ensures that only a table with no dependent views or
       integrity constraints can be destroyed.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term>CASCADE</term>
     <listitem>
      <para>
       Any referencing views or integrity constraints
       will also be dropped.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
    <tip>
    <para>
     At present, to remove a referencing view you must drop
     it explicitly.
    </para>
   </tip>
@


1.14
log
@Update SQL-command reference pages for schema features.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_table.sgml,v 1.13 2002/04/21 19:02:39 thomas Exp $
d59 1
a59 1
DROP
@


1.13
log
@Augment the date/time examples in the User's Guide to reflect the newer
 capabilities of specifying time zones as intervals per SQL9x.
Put refentrytitle contents on the same line as the tag.
 Otherwise, leading whitespace is propagated into the product, which
 (at least) messes up the ToC layout.
Remove (some) docinfo tags containing dates. Best to omit if the dates
 are not accurate; maybe use CVS dates instead or leave them out.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_table.sgml,v 1.12 2001/12/08 03:24:36 thomas Exp $
d40 1
a40 1
	The name of an existing table to drop.
d91 2
a92 2
   Only its owner may destroy a table. A table
   may be emptied of rows, but not destroyed, by using <command>DELETE</command>.
d99 4
d173 1
a173 1
     At present, to remove a referenced view you must drop
@


1.12
log
@Use PostgreSQL consistantly throughout docs. Before, usage was split evenly
 between Postgres and PostgreSQL.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_table.sgml,v 1.11 2001/09/03 12:57:49 petere Exp $
d8 1
a8 3
  <refentrytitle id="SQL-DROPTABLE-TITLE">
   DROP TABLE
  </refentrytitle>
@


1.11
log
@Put some kind of grammatical uniformity in the <refpurpose> lines.
@
text
@d2 2
a3 2
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/drop_table.sgml,v 1.10 2001/08/13 15:24:46 momjian Exp $
Postgres documentation
@


1.10
log
@Patch NAME section of reference pages.
@
text
@d2 1
a2 1
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/drop_table.sgml,v 1.9 2000/10/22 23:32:38 tgl Exp $
d18 1
a18 1
   Removes tables from a database
@


1.9
log
@Some small polishing of Mark Hollomon's cleanup of DROP command: might
as well allow DROP multiple INDEX, RULE, TYPE as well.  Add missing
CommandCounterIncrement to DROP loop, which could cause trouble otherwise
with multiple DROP of items affecting same catalog entries.  Try to
bring a little consistency to various error messages using 'does not exist',
'nonexistent', etc --- I standardized on 'does not exist' since that's
what the vast majority of the existing uses seem to be.
@
text
@d2 1
a2 1
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/drop_table.sgml,v 1.8 2000/10/18 16:16:03 momjian Exp $
d18 1
a18 1
   Removes existing tables from a database
@


1.8
log
@The following patch was sent to the patches list:

This patch forces the use of 'DROP VIEW' to destroy views.

It also changes the syntax of DROP VIEW to
DROP VIEW v1, v2, ...
to match the syntax of DROP TABLE.

Some error messages were changed so this patch also includes changes to the
appropriate expected/*.out files.

Doc changes for 'DROP TABLE" and 'DROP VIEW' are included.


--
Mark Hollomon
@
text
@d2 1
a2 1
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/drop_table.sgml,v 1.7 2000/07/21 04:37:10 momjian Exp $
d71 1
a71 1
ERROR: table "<replaceable class="parameter">name</replaceable>" is nonexistent
@


1.7
log
@Cleanujp
@
text
@d2 1
a2 1
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/drop_table.sgml,v 1.6 1999/07/22 15:09:11 thomas Exp $
d42 1
a42 1
	The name of an existing table or view to drop.
d71 1
a71 1
ERROR Relation "<replaceable class="parameter">name</replaceable>" Does Not Exist!
d75 1
a75 1
	If the specified table or view does not exist in the database.
d92 2
a93 2
   <command>DROP TABLE</command> removes tables and views from the database.
   Only its owner may destroy a table or view. A table
@


1.6
log
@Complete merge of all old man page information.
ecpg reference page still needs formatting.
@
text
@d2 1
a2 1
$Header$
d123 1
a123 1
   <command>distributors</command>:
@


1.5
log
@Fix markup for docbook2man man page generation.
No big deal; fixed lots of other markup at the same time.
Bigest change: make sure there is no whitespace
 in front of <term> contents.
This will probably help the other output types too.
@
text
@d1 5
d8 1
a8 1
  <refentrytitle>
d23 1
a23 1
   <date>1998-09-22</date>
a134 2
  <para>
  </para>
@


1.4
log
@Clean up to ensure tag completion as required by the newest versions
 of Norm's Modular Style Sheets and jade/docbook.
From Vince Vielhaber <vev@@michvhf.com>.
@
text
@d1 3
a3 3
<REFENTRY ID="SQL-DROPTABLE">
 <REFMETA>
  <REFENTRYTITLE>
d5 5
a9 5
  </REFENTRYTITLE>
  <REFMISCINFO>SQL - Language Statements</REFMISCINFO>
 </REFMETA>
 <REFNAMEDIV>
  <REFNAME>
d11 2
a12 2
  </REFNAME>
  <REFPURPOSE>
d14 1
a14 1
  </REFPURPOSE>
d16 7
a22 7
 <REFSYNOPSISDIV>
  <REFSYNOPSISDIVINFO>
   <DATE>1998-09-22</DATE>
  </REFSYNOPSISDIVINFO>
  <SYNOPSIS>
DROP TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> [, ...]
  </SYNOPSIS>
d24 5
a28 5
  <REFSECT2 ID="R2-SQL-DROPTABLE-1">
   <REFSECT2INFO>
    <DATE>1998-09-22</DATE>
   </REFSECT2INFO>
   <TITLE>
d30 20
a49 22
   </TITLE>
   <PARA>
   </PARA>
       <VARIABLELIST>
	<VARLISTENTRY>
	 <TERM>
	  <ReturnValue><REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE></ReturnValue>
	 </TERM>
	 <LISTITEM>
	  <PARA>
	   The name of an existing table or view to drop.
	  </PARA>
	 </LISTITEM>
	</VARLISTENTRY>
       </variablelist>
  </REFSECT2>
  
  <REFSECT2 ID="R2-SQL-DROPTABLE-2">
   <REFSECT2INFO>
    <DATE>1998-09-22</DATE>
   </REFSECT2INFO>
   <TITLE>
d51 20
a70 20
   </TITLE>
   <PARA>
       <VARIABLELIST>
	<VARLISTENTRY>
	 <TERM>
	  <ReturnValue>DROP</ReturnValue>
	 </TERM>
	 <LISTITEM>
	  <PARA>
	   The message returned if the command completes successfully.
	  </PARA>
	 </LISTITEM>
	</VARLISTENTRY>
	<VARLISTENTRY>
	 <TERM>
	  <ReturnValue> ERROR Relation "<replaceable class="parameter">table</replaceable>" Does Not Exist!</ReturnValue>
	 </TERM>
	 <LISTITEM>
	  <PARA>
	   If the specified table or view does not exist in the database.
d74 1
a74 1
    </VARIABLELIST>
d76 2
a77 2
  </REFSECT2>
 </REFSYNOPSISDIV>
d79 5
a83 5
 <REFSECT1 ID="R1-SQL-DROPTABLE-1">
  <REFSECT1INFO>
   <DATE>1998-09-22</DATE>
  </REFSECT1INFO>
  <TITLE>
d85 3
a87 3
  </TITLE>
  <PARA>
<command>DROP TABLE</command> removes tables and views from the database.
d90 2
a91 2
  </PARA>
  <PARA>
d95 7
a101 7
  </PARA>
  
  <REFSECT2 ID="R2-SQL-DROPTABLE-3">
   <REFSECT2INFO>
    <DATE>1998-09-22</DATE>
   </REFSECT2INFO>
   <TITLE>
d103 2
a104 2
   </TITLE>
   <PARA>
d108 2
a109 2
   </PARA>
  </REFSECT2>
d111 3
a113 3
 
 <REFSECT1 ID="R1-SQL-DROPTABLE-2">
  <TITLE>
d115 10
a124 9
  </TITLE>
  <PARA>
   To destroy the <literal>films</literal> and 
   <command>distributors</command> tables:
  </PARA>
  <ProgramListing>
DROP TABLE films, distributors
  </ProgramListing>
 </REFSECT1>
d126 2
a127 2
 <REFSECT1 ID="R1-SQL-DROPTABLE-3">
   <TITLE>
d129 3
a131 3
  </TITLE>
  <PARA>
   </PARA>
d133 5
a137 5
  <REFSECT2 ID="R2-SQL-DROPTABLE-4">
   <REFSECT2INFO>
    <DATE>1998-09-22</DATE>
   </REFSECT2INFO>
   <TITLE>
d139 2
a140 2
   </TITLE>
   <PARA>
d142 1
a142 1
   </PARA>
d174 1
a174 1
</REFENTRY>
d179 1
a179 1
sgml-omittag:t
@


1.3
log
@Minor cleanup in markup, especially in the Output section.
@
text
@d15 1
a15 1
  
d73 5
a77 1
   </VARIABLELIST>
@


1.2
log
@Editing and markup cleanup.
@
text
@a54 8
   </PARA>
   <VARIABLELIST>
    <VARLISTENTRY>
     <TERM>
<replaceable>status</replaceable>
     </TERM>
     <LISTITEM>
      <PARA>
a72 6
	  </PARA>
	 </LISTITEM>
	</VARLISTENTRY>
       </variablelist>
     </LISTITEM>
    </VARLISTENTRY>
@


1.1
log
@Add new reference pages. This completes the first cut at a full set
 for SQL commands.
@
text
@d18 1
a18 1
   <DATE>1998-04-15</DATE>
d21 1
a21 1
   DROP TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> [, ...]
d26 1
a26 1
    <DATE>1998-04-15</DATE>
a32 6
   <VARIABLELIST>
    <VARLISTENTRY>
     <TERM>
     </TERM>
     <LISTITEM>
      <PARA>
a44 3
     </LISTITEM>
    </VARLISTENTRY>
   </VARIABLELIST>
d49 1
a49 1
    <DATE>1998-04-15</DATE>
d59 1
d80 1
a80 1
	   If table/view specified doesn't exist into database.
d93 1
a93 1
   <DATE>1998-04-15</DATE>
d98 2
a99 2
  <PARA><command>
   </command>DROP TABLE removes tables and views from the database.
d101 1
a101 1
   may be emptied of rows, but not destroyed, by using DELETE.
d104 1
a104 1
   If a table being destroyed has secondary indices on it,
d106 1
a106 1
   secondary index will not affect the indexed table.
d111 1
a111 1
    <DATE>1998-04-15</DATE>
d117 2
a118 2
    Refer to the <command>CREATE TABLE</command> and
    <command>ALTER TABLE</command> statements for information on
d133 1
a133 1
   DROP TABLE films, distributors
d146 1
a146 1
    <DATE>1998-04-15</DATE>
d155 1
a155 1
    DROP TABLE <replaceable class="parameter">table</replaceable> { RESTRICT | CASCADE }
d180 1
a180 1
     it by hand.
@
