head	1.10;
access;
symbols
	REL9_0_0:1.10
	REL9_1_ALPHA1:1.10
	REL9_0_RC1:1.10
	REL9_0_BETA4:1.10
	REL9_0_STABLE:1.10.0.2
	REL9_0_BETA3:1.10
	REL9_0_BETA2:1.10
	REL7_4_29:1.5
	REL8_0_25:1.6
	REL8_1_21:1.6
	REL8_2_17:1.8
	REL8_3_11:1.8
	REL8_4_4:1.9
	REL9_0_BETA1:1.10
	REL9_0_ALPHA5_BRANCH:1.9.0.12
	REL9_0_ALPHA5:1.9
	REL7_4_28:1.5
	REL8_0_24:1.6
	REL8_1_20:1.6
	REL8_2_16:1.8
	REL8_3_10:1.8
	REL8_4_3:1.9
	REL9_0_ALPHA4:1.9
	REL9_0_ALPHA4_BRANCH:1.9.0.10
	REL8_5_ALPHA3:1.9
	REL8_5_ALPHA3_BRANCH:1.9.0.8
	REL7_4_27:1.5
	REL8_0_23:1.6
	REL8_1_19:1.6
	REL8_2_15:1.8
	REL8_3_9:1.8
	REL8_4_2:1.9
	REL8_5_ALPHA2:1.9
	REL8_5_ALPHA2_BRANCH:1.9.0.6
	REL7_4_26:1.5
	REL8_0_22:1.6
	REL8_1_18:1.6
	REL8_2_14:1.8
	REL8_3_8:1.8
	REL8_4_1:1.9
	REL8_5_ALPHA1:1.9
	REL8_5_ALPHA1_BRANCH:1.9.0.4
	REL8_4_STABLE:1.9.0.2
	REL8_4_0:1.9
	REL8_4_RC2:1.9
	REL8_4_RC1:1.9
	REL8_4_BETA2:1.9
	REL8_4_BETA1:1.9
	REL7_4_25:1.5
	REL8_0_21:1.6
	REL8_1_17:1.6
	REL8_2_13:1.8
	REL8_3_7:1.8
	REL7_4_24:1.5
	REL8_0_20:1.6
	REL8_1_16:1.6
	REL8_2_12:1.8
	REL8_3_6:1.8
	REL7_4_23:1.5
	REL8_0_19:1.6
	REL8_1_15:1.6
	REL8_2_11:1.8
	REL8_3_5:1.8
	REL7_4_22:1.5
	REL8_0_18:1.6
	REL8_1_14:1.6
	REL8_2_10:1.8
	REL8_3_4:1.8
	REL7_4_21:1.5
	REL8_0_17:1.6
	REL8_1_13:1.6
	REL8_2_9:1.8
	REL8_3_3:1.8
	REL7_4_20:1.5
	REL8_0_16:1.6
	REL8_1_12:1.6
	REL8_2_8:1.8
	REL8_3_2:1.8
	REL8_2_7:1.8
	REL8_3_1:1.8
	REL8_3_STABLE:1.8.0.4
	REL8_3_0:1.8
	REL8_3_RC2:1.8
	REL7_3_21:1.1
	REL7_4_19:1.5
	REL8_0_15:1.6
	REL8_1_11:1.6
	REL8_2_6:1.8
	REL8_3_RC1:1.8
	REL8_3_BETA4:1.8
	REL8_3_BETA3:1.8
	REL8_3_BETA2:1.8
	REL8_3_BETA1:1.8
	REL7_3_20:1.1
	REL7_4_18:1.5
	REL8_0_14:1.6
	REL8_1_10:1.6
	REL8_2_5:1.8
	REL7_3_19:1.1
	REL7_4_17:1.5
	REL8_0_13:1.6
	REL8_1_9:1.6
	REL8_2_4:1.8
	REL8_0_12:1.6
	REL8_1_8:1.6
	REL8_2_3:1.8
	REL7_3_18:1.1
	REL7_4_16:1.5
	REL8_0_11:1.6
	REL8_1_7:1.6
	REL8_2_2:1.8
	REL8_0_10:1.6
	REL8_1_6:1.6
	REL8_2_1:1.8
	REL7_4_15:1.5
	REL7_3_17:1.1
	REL8_2_STABLE:1.8.0.2
	REL8_2_0:1.8
	REL8_2_RC1:1.8
	REL8_2_BETA3:1.8
	REL8_2_BETA2:1.8
	REL8_1_5:1.6
	REL8_0_9:1.6
	REL7_4_14:1.5
	REL7_3_16:1.1
	REL8_2_BETA1:1.8
	REL7_3_15:1.1
	REL7_4_13:1.5
	REL8_0_8:1.6
	REL8_1_4:1.6
	REL7_3_14:1.1
	REL7_4_12:1.5
	REL8_0_7:1.6
	REL8_1_3:1.6
	REL7_3_13:1.1
	REL7_4_11:1.5
	REL8_0_6:1.6
	REL8_1_2:1.6
	REL7_3_12:1.1
	REL7_4_10:1.5
	REL8_0_5:1.6
	REL8_1_1:1.6
	REL8_1_STABLE:1.6.0.6
	REL8_1_0:1.6
	REL8_1_0RC1:1.6
	REL8_1_0BETA4:1.6
	REL8_1_0BETA3:1.6
	REL7_3_11:1.1
	REL7_4_9:1.5
	REL8_0_4:1.6
	REL8_1_0BETA2:1.6
	REL8_1_0BETA1:1.6
	REL7_3_10:1.1
	REL7_4_8:1.5
	REL8_0_3:1.6
	REL8_0_2:1.6
	REL7_3_9:1.1
	REL7_4_7:1.5
	REL8_0_1:1.6
	REL8_0_STABLE:1.6.0.4
	REL8_0_0:1.6.0.2
	REL8_0_0RC5:1.6
	REL8_0_0RC4:1.6
	REL8_0_0RC3:1.6
	REL8_0_0RC2:1.6
	REL8_0_0RC1:1.6
	REL8_0_0BETA5:1.6
	REL8_0_0BETA4:1.6
	REL7_4_6:1.5
	REL7_3_8:1.1
	REL8_0_0BETA3:1.6
	REL8_0_0BETA2:1.6
	REL7_4_5:1.5
	REL7_3_7:1.1
	REL7_4_4:1.5
	REL8_0_0BETA1:1.6
	REL7_4_3:1.5
	REL7_4_2:1.5
	REL7_3_6:1.1
	REL7_4_1:1.5
	REL7_3_5:1.1
	REL7_4:1.5
	REL7_4_RC2:1.5
	REL7_4_STABLE:1.5.0.2
	REL7_4_RC1:1.5
	REL7_4_BETA5:1.5
	REL7_4_BETA4:1.5
	REL7_4_BETA3:1.5
	REL7_4_BETA2:1.3
	WIN32_DEV:1.3.0.2
	REL7_4_BETA1:1.3
	REL7_3_4:1.1
	REL7_3_2:1.1
	REL7_3_STABLE:1.1.0.2;
locks; strict;
comment	@# @;


1.10
date	2010.04.03.07.23.01;	author petere;	state Exp;
branches;
next	1.9;

1.9
date	2008.11.14.10.22.46;	author petere;	state Exp;
branches;
next	1.8;

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

1.7
date	2005.11.19.17.39.44;	author adunstan;	state Exp;
branches;
next	1.6;

1.6
date	2003.11.29.19.51.38;	author pgsql;	state Exp;
branches;
next	1.5;

1.5
date	2003.09.09.18.28.53;	author tgl;	state Exp;
branches;
next	1.4;

1.4
date	2003.08.31.17.32.22;	author petere;	state Exp;
branches;
next	1.3;

1.3
date	2003.06.27.14.45.26;	author petere;	state Exp;
branches
	1.3.2.1;
next	1.2;

1.2
date	2003.05.04.02.23.16;	author petere;	state Exp;
branches;
next	1.1;

1.1
date	2002.07.18.16.47.22;	author tgl;	state Exp;
branches;
next	;

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


desc
@@


1.10
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_schema.sgml,v 1.9 2008/11/14 10:22:46 petere Exp $
PostgreSQL documentation
-->

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

 <refnamediv>
  <refname>DROP SCHEMA</refname>
  <refpurpose>remove a schema</refpurpose>
 </refnamediv>

 <indexterm zone="sql-dropschema">
  <primary>DROP SCHEMA</primary>
 </indexterm>

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

 <refsect1>
  <title>Description</title>

  <para>
   <command>DROP SCHEMA</command> removes schemas from the database.
  </para>

  <para>
   A schema can only be dropped by its owner or a superuser.  Note that
   the owner can drop the schema (and thereby all contained objects)
   even if he does not own some of the objects within the schema.
  </para>
 </refsect1>
  
 <refsect1>
  <title>Parameters</title>

  <variablelist>
   <varlistentry>
    <term><literal>IF EXISTS</literal></term>
    <listitem>
     <para>
      Do not throw an error if the schema 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 of a schema.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>CASCADE</literal></term>
    <listitem>
     <para>
      Automatically drop objects (tables, functions, etc.) that are
      contained in the schema.
     </para>
    </listitem>
   </varlistentry>

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

 <refsect1>
  <title>Examples</title>

  <para>
   To remove schema <literal>mystuff</literal> from the database,
   along with everything it contains:

<programlisting>
DROP SCHEMA mystuff CASCADE;
</programlisting>
  </para>
 </refsect1>
 
 <refsect1>
  <title>Compatibility</title>
  
  <para>
   <command>DROP SCHEMA</command> is fully conforming with the SQL
   standard, except that the standard only allows one schema 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-alterschema"></member>
   <member><xref linkend="sql-createschema"></member>
  </simplelist>
 </refsect1>

</refentry>
@


1.9
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_schema.sgml,v 1.8 2006/09/16 00:30:18 momjian Exp $
d8 1
a8 1
  <refentrytitle id="SQL-DROPSCHEMA-TITLE">DROP SCHEMA</refentrytitle>
d116 2
a117 2
   <member><xref linkend="sql-alterschema" endterm="sql-alterschema-title"></member>
   <member><xref linkend="sql-createschema" endterm="sql-createschema-title"></member>
@


1.8
log
@Remove emacs info from footer of SGML files.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/drop_schema.sgml,v 1.7 2005/11/19 17:39:44 adunstan Exp $
d9 1
@


1.7
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_schema.sgml,v 1.6 2003/11/29 19:51:38 pgsql Exp $
a120 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.6
log
@
$Header: -> $PostgreSQL Changes ...
@
text
@d2 1
a2 1
$PostgreSQL: /cvsroot/pgsql-server/doc/src/sgml/ref/drop_schema.sgml,v 1.5 2003/09/09 18:28:53 tgl Exp $
d23 1
a23 1
DROP SCHEMA <replaceable class="PARAMETER">name</replaceable> [, ...] [ CASCADE | RESTRICT ]
d46 10
d105 3
a107 1
   dropped per command.
@


1.5
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_schema.sgml,v 1.4 2003/08/31 17:32:22 petere Exp $
@


1.4
log
@Add/edit index entries.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/drop_schema.sgml,v 1.3 2003/06/27 14:45:26 petere Exp $
a69 24
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1>
  <title>Diagnostics</title>

  <variablelist>
   <varlistentry>
    <term><computeroutput>DROP SCHEMA</computeroutput></term>
    <listitem>
     <para>
      Message returned if the schema was successfully dropped.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><computeroutput>ERROR: Schema "<replaceable class="parameter">name</replaceable>" does not exist</computeroutput></term>
    <listitem>
     <para>
      This message is returned if the specified schema does not exist.
@


1.3
log
@First batch of object rename commands.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/drop_schema.sgml,v 1.2 2003/05/04 02:23:16 petere Exp $
d16 4
@


1.3.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_schema.sgml,v 1.4 2003/08/31 17:32:22 petere Exp $
a15 4

 <indexterm zone="sql-dropschema">
  <primary>DROP SCHEMA</primary>
 </indexterm>
@


1.2
log
@Last round of reference page editing.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/drop_schema.sgml,v 1.1 2002/07/18 16:47:22 tgl Exp $
d123 1
@


1.1
log
@Implement DROP SCHEMA.  It lacks support for dropping conversions and
operator classes, both of which are schema-local and so should really
be droppable.
@
text
@d2 1
a2 1
$Header$
d11 1
d13 2
a14 6
  <refname>
   DROP SCHEMA
  </refname>
  <refpurpose>
   remove a schema
  </refpurpose>
d16 1
d18 1
a18 4
  <refsynopsisdivinfo>
   <date>2002-07-18</date>
  </refsynopsisdivinfo>
  <synopsis>
d20 2
d23 2
a24 76
  </synopsis>
  
  <refsect2 id="R2-SQL-DROPSCHEMA-1">
   <refsect2info>
    <date>2002-07-18</date>
   </refsect2info>
   <title>
    Inputs
   </title>
   <para>
    <variablelist>
     <varlistentry>
      <term><replaceable class="PARAMETER">name</replaceable></term>
      <listitem>
       <para>
	The name of a schema.
       </para>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term>CASCADE</term>
      <listitem>
       <para>
        Automatically drop objects (tables, functions, etc) that are contained
	in the schema.
       </para>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term>RESTRICT</term>
      <listitem>
       <para>
        Refuse to drop the schema if it contains any objects.
	This is the default.
       </para>
      </listitem>
     </varlistentry>
    </variablelist>
   </para>
  </refsect2>

  <refsect2 id="R2-SQL-DROPSCHEMA-2">
   <refsect2info>
    <date>2002-07-18</date>
   </refsect2info>
   <title>
    Outputs
   </title>
   <para>

    <variablelist>
     <varlistentry>
      <term><computeroutput>
DROP SCHEMA
       </computeroutput></term>
      <listitem>
       <para>
	The message returned if the schema is successfully dropped.
       </para>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term><computeroutput>
ERROR: Schema "<replaceable class="parameter">name</replaceable>" does not exist
       </computeroutput></term>
      <listitem>
       <para>
	This message occurs if the specified schema does not exist.
       </para>
      </listitem>
     </varlistentry>
    </variablelist>

   </para>
  </refsect2>
 </refsynopsisdiv>
a25 7
 <refsect1 id="R1-SQL-DROPSCHEMA-1">
  <refsect1info>
   <date>2002-07-18</date>
  </refsect1info>
  <title>
   Description
  </title>
d27 1
a27 1
   <command>DROP SCHEMA</command> removes schemas from the data base.
d35 63
a98 18
  <refsect2 id="R2-SQL-DROPSCHEMA-3">
   <refsect2info>
    <date>2002-07-18</date>
   </refsect2info>
   <title>
    Notes
   </title>
   <para>
    Refer to the <command>CREATE SCHEMA</command> statement for
    information on how to create a schema.
   </para>
  </refsect2>
 </refsect1>

 <refsect1 id="R1-SQL-DROPSCHEMA-2">
  <title>
   Usage
  </title>
d103 1
a103 1
   <programlisting>
d105 1
a105 1
   </programlisting>
d109 2
a110 4
 <refsect1 id="R1-SQL-DROPSCHEMA-3">
  <title>
   Compatibility
  </title>
d112 5
a116 13
  <refsect2 id="R2-SQL-DROPSCHEMA-4">
   <refsect2info>
    <date>2002-07-18</date>
   </refsect2info>
   <title>
    SQL92
   </title>
   <para>
    <command>DROP SCHEMA</command> is fully compatible with
    <acronym>SQL92</acronym>, except that the standard only allows
    one schema to be dropped per command.
   </para>
  </refsect2>
d118 9
@
