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


1.25
date	2010.04.03.07.23.00;	author petere;	state Exp;
branches;
next	1.24;

1.24
date	2008.11.14.10.22.46;	author petere;	state Exp;
branches;
next	1.23;

1.23
date	2006.09.16.00.30.18;	author momjian;	state Exp;
branches;
next	1.22;

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

1.21
date	2005.11.22.15.24.17;	author adunstan;	state Exp;
branches;
next	1.20;

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

1.19
date	2003.11.29.19.51.38;	author pgsql;	state Exp;
branches;
next	1.18;

1.18
date	2003.09.12.00.12.47;	author tgl;	state Exp;
branches;
next	1.17;

1.17
date	2003.08.31.17.32.22;	author petere;	state Exp;
branches;
next	1.16;

1.16
date	2003.05.04.02.23.16;	author petere;	state Exp;
branches
	1.16.2.1;
next	1.15;

1.15
date	2002.04.21.19.02.39;	author thomas;	state Exp;
branches;
next	1.14;

1.14
date	2001.12.08.03.24.35;	author thomas;	state Exp;
branches;
next	1.13;

1.13
date	2001.11.18.00.38.00;	author tgl;	state Exp;
branches;
next	1.12;

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

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

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

1.9
date	99.12.12.05.15.09;	author momjian;	state Exp;
branches;
next	1.8;

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

1.7
date	99.08.06.13.50.30;	author thomas;	state Exp;
branches;
next	1.6;

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

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

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

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

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

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

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


desc
@@


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

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

 <refnamediv>
  <refname>DROP DATABASE</refname>
  <refpurpose>remove a database</refpurpose>
 </refnamediv>

 <indexterm zone="sql-dropdatabase">
  <primary>DROP DATABASE</primary>
 </indexterm>

 <refsynopsisdiv>
<synopsis>
DROP DATABASE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable>
</synopsis>
 </refsynopsisdiv>
 
 <refsect1>
  <title>Description</title>

  <para>
   <command>DROP DATABASE</command> drops a database. It removes the
   catalog entries for the database and deletes the directory
   containing the data.  It can only be executed by the database owner.
   Also, it cannot be executed while you or anyone else are connected
   to the target database.  (Connect to <literal>postgres</literal> or any
   other database to issue this command.) 
  </para>

  <para>
   <command>DROP DATABASE</command> cannot be undone.  Use it with care!
  </para>
 </refsect1>

 <refsect1>
  <title>Parameters</title>

  <variablelist>
   <varlistentry>
    <term><literal>IF EXISTS</literal></term>
    <listitem>
     <para>
      Do not throw an error if the database 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 the database to remove.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1>
  <title>Notes</title>

   <para>
    <command>DROP DATABASE</> cannot be executed inside a transaction
    block.
   </para>

  <para>
   This command cannot be executed while connected to the target
   database. Thus, it might be more convenient to use the program
   <xref linkend="app-dropdb"> instead,
   which is a wrapper around this command.
  </para>
 </refsect1>

 <refsect1>
  <title>Compatibility</title>

  <para>
   There is no <command>DROP DATABASE</command> statement in the SQL standard.
  </para>
 </refsect1>

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

  <simplelist type="inline">
   <member><xref linkend="sql-createdatabase"></member>
  </simplelist>
 </refsect1>
</refentry>
@


1.24
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_database.sgml,v 1.23 2006/09/16 00:30:18 momjian Exp $
d8 1
a8 1
  <refentrytitle id="SQL-DROPDATABASE-TITLE">DROP DATABASE</refentrytitle>
d81 1
a81 1
   <xref linkend="app-dropdb" endterm="app-dropdb-title"> instead,
d98 1
a98 1
   <member><xref linkend="sql-createdatabase" endterm="sql-createdatabase-title"></member>
@


1.23
log
@Remove emacs info from footer of SGML files.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/drop_database.sgml,v 1.22 2006/05/04 16:07:29 tgl Exp $
d9 1
@


1.22
log
@Rethink the locking mechanisms used for CREATE/DROP/RENAME DATABASE.
The former approach used ExclusiveLock on pg_database, which being a
cluster-wide lock meant only one of these operations could proceed at
a time; worse, it also blocked all incoming connections in ReverifyMyDatabase.
Now that we have LockSharedObject(), we can use locks of different types
applied to databases considered as objects.  This allows much more
flexible management of the interlocking: two CREATE DATABASEs need not
block each other, and need not block connections except to the template
database being used.  Similarly DROP DATABASE doesn't block unrelated
operations.  The locking used in flatfiles.c is also much narrower in
scope than before.  Per recent proposal.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/drop_database.sgml,v 1.21 2005/11/22 15:24:17 adunstan Exp $
a100 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.21
log
@
 DROP DATABASE IF EXISTS variant
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/drop_database.sgml,v 1.20 2005/06/21 04:02:31 tgl Exp $
d89 1
a89 1
   The is no <command>DROP DATABASE</command> statement in the SQL standard.
@


1.20
log
@Cause initdb to create a third standard database "postgres", which
unlike template0 and template1 does not have any special status in
terms of backend functionality.  However, all external utilities such
as createuser and createdb now connect to "postgres" instead of
template1, and the documentation is changed to encourage people to use
"postgres" instead of template1 as a play area.  This should fix some
longstanding gotchas involving unexpected propagation of database
objects by createdb (when you used template1 without understanding
the implications), as well as ameliorating the problem that CREATE
DATABASE is unhappy if anyone else is connected to template1.
Patch by Dave Page, minor editing by Tom Lane.  All per recent
pghackers discussions.
@
text
@d2 1
a2 1
$PostgreSQL: pgsql/doc/src/sgml/ref/drop_database.sgml,v 1.19 2003/11/29 19:51:38 pgsql Exp $
d23 1
a23 1
DROP DATABASE <replaceable class="PARAMETER">name</replaceable>
d49 10
@


1.19
log
@
$Header: -> $PostgreSQL Changes ...
@
text
@d2 1
a2 1
$PostgreSQL: /cvsroot/pgsql-server/doc/src/sgml/ref/drop_database.sgml,v 1.18 2003/09/12 00:12:47 tgl Exp $
d35 1
a35 1
   to the target database.  (Connect to <literal>template1</literal> or any
@


1.18
log
@More cleanup of Diagnostics sections.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/drop_database.sgml,v 1.17 2003/08/31 17:32:22 petere Exp $
@


1.17
log
@Add/edit index entries.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/drop_database.sgml,v 1.16 2003/05/04 02:23:16 petere Exp $
d34 3
d60 1
a60 33
  <title>Diagnostics</title>

    <variablelist>
     <varlistentry>
      <term><computeroutput>DROP DATABASE</computeroutput></term>
      <listitem>
       <para>
        This message is returned if the command was successful.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><computeroutput>DROP DATABASE: cannot be executed on the currently open database</computeroutput></term>
      <listitem>
       <para>
        You cannot be connected to the database you are about to remove.
        Instead, connect to <literal>template1</literal> or any other
        database and run this command again.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><computeroutput>DROP DATABASE: may not be called in a transaction block</computeroutput></term>
      <listitem>
       <para>
        You must finish the transaction in progress before you can call this command.
       </para>
      </listitem>
     </varlistentry>
    </variablelist>
 </refsect1>
d62 4
a65 2
 <refsect1>
  <title>Notes</title>
@


1.16
log
@Last round of reference page editing.
@
text
@d2 1
a2 1
$Header: /cvsroot/pgsql-server/doc/src/sgml/ref/drop_database.sgml,v 1.15 2002/04/21 19:02:39 thomas Exp $
d16 4
@


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

 <indexterm zone="sql-dropdatabase">
  <primary>DROP DATABASE</primary>
 </indexterm>
@


1.15
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_database.sgml,v 1.14 2001/12/08 03:24:35 thomas Exp $
d11 1
d13 2
a14 6
  <refname>
   DROP DATABASE
  </refname>
  <refpurpose>
   remove a database
  </refpurpose>
d16 1
d18 1
a18 4
  <refsynopsisdivinfo>
   <date>1999-12-11</date>
  </refsynopsisdivinfo>
  <synopsis>
d20 5
a24 1
  </synopsis>
d26 25
a50 20
  <refsect2 id="R2-SQL-DROPDATABASE-1">
   <refsect2info>
    <date>1999-12-11</date>
   </refsect2info>
   <title>
    Inputs
   </title>
   <para>
    <variablelist>
     <varlistentry>
      <term><replaceable class="PARAMETER">name</replaceable></term>
      <listitem>
       <para>
	The name of an existing database to remove.
       </para>
      </listitem>
     </varlistentry>
    </variablelist>
   </para>
  </refsect2>
d52 2
a53 8
  <refsect2 id="R2-SQL-DROPDATABASE-2">
   <refsect2info>
    <date>1999-12-11</date>
   </refsect2info>
   <title>
    Outputs
   </title>
   <para>
a55 1

d60 1
a60 1
	This message is returned if the command is successful.
d84 5
a89 12
    </variablelist>
   </para>
  </refsect2>
 </refsynopsisdiv>
 
 <refsect1 id="R1-SQL-DROPDATABASE-1">
  <refsect1info>
   <date>1999-12-11</date>
  </refsect1info>
  <title>
   Description
  </title>
d91 4
a94 4
   <command>DROP DATABASE</command> removes the catalog entries for an existing
   database and deletes the directory containing the data.
   It can only be executed by the database owner (usually the user that created
   it).
d96 4
d102 1
a102 1
   <command>DROP DATABASE</command> cannot be undone.  Use it with care!
d104 1
d106 2
a107 22
  <refsect2 id="R2-SQL-DROPDATABASE-3">
   <refsect2info>
    <date>1999-12-11</date>
   </refsect2info>
   <title>
    Notes
   </title>

   <para>
    This command cannot be executed while connected to the target
    database. Thus, it might be more convenient to use the shell
    script <xref linkend="app-dropdb" endterm="app-dropdb-title">,
    which is a wrapper around this command, instead.
   </para>

   <para>
    Refer to
    <xref linkend="sql-createdatabase" endterm="sql-createdatabase-title">
    for information on how to create a database.
   </para>
  </refsect2>
 </refsect1>
d109 3
a111 19
 <refsect1 id="R1-SQL-DROPDATABASE-3">
  <title>
   Compatibility
  </title>

  <refsect2 id="R2-SQL-DROPDATABASE-4">
   <refsect2info>
    <date>1998-04-15</date>
   </refsect2info>
   <title>
    SQL92
   </title>

   <para>
    <command>DROP DATABASE</command> statement is a
    <productname>PostgreSQL</productname> language extension;
    there is no such command in <acronym>SQL92</acronym>.
   </para>
  </refsect2>
@


1.14
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_database.sgml,v 1.13 2001/11/18 00:38:00 tgl Exp $
d8 1
a8 3
  <refentrytitle id="SQL-DROPDATABASE-TITLE">
   DROP DATABASE
  </refentrytitle>
@


1.13
log
@Clean up treatment of creating/dropping databases in User's Guide and
Admin Guide.  Move discussion of template databases out of footnotes
in CREATE DATABASE ref page and into a section of the Admin Guide.
Clean up various obsolete claims, do some copy-editing.
@
text
@d2 2
a3 2
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_database.sgml,v 1.12 2001/09/03 12:57:49 petere Exp $
Postgres documentation
d151 1
a151 1
    <productname>Postgres</productname> language extension;
@


1.12
log
@Put some kind of grammatical uniformity in the <refpurpose> lines.
@
text
@d2 1
a2 1
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/drop_database.sgml,v 1.11 2000/11/11 23:01:43 petere Exp $
d71 1
a71 1
      <term><computeroutput>ERROR:  user '<replaceable class="parameter">username</replaceable>' is not allowed to create/drop databases</computeroutput></term>
d74 2
a75 22
        You must have the special CREATEDB privilege to drop databases.
        See <xref linkend="SQL-CREATEUSER" endterm="SQL-CREATEUSER-title">.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><computeroutput>ERROR:  dropdb: cannot be executed on the template database</computeroutput></term>
      <listitem>
       <para>
        The <literal>template1</literal> database cannot be removed. It's not in
        your interest.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><computeroutput>ERROR:  dropdb: cannot be executed on an open database</computeroutput></term>
      <listitem>
       <para>
        You cannot be connected to the database your are about to remove.
        Instead, you could connect to <literal>template1</literal> or any other
d82 1
a82 20
      <term><computeroutput>ERROR:  dropdb: database '<replaceable class="parameter">name</replaceable>' does not exist</computeroutput></term>
      <listitem>
       <para>
	This message occurs if the specified database does not exist.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><computeroutput>ERROR:  dropdb: database '<replaceable class="parameter">name</replaceable>' is not owned by you</computeroutput></term>
      <listitem>
       <para>
        You must be the owner of the database. Being the owner usually means that
        you created it as well.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><computeroutput>ERROR:  dropdb: May not be called in a transaction block.</computeroutput></term>
a89 11
     <varlistentry>
      <term><computeroutput>NOTICE:  The database directory 'xxx' could not be removed.</computeroutput></term>
      <listitem>
       <para>
        The database was dropped (unless other error messages came up), but the
        directory where the data is stored could not be removed. You must delete
        it manually.
       </para>
      </listitem>
     </varlistentry>

d107 4
@


1.11
log
@Markup enhancements, some factual corrections.
@
text
@d2 1
a2 1
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/drop_database.sgml,v 1.10 2000/10/05 19:48:18 momjian Exp $
d18 1
a18 1
   Removes an existing database
@


1.10
log
@Add proofreader's changes to docs.
Fix misspelling of disbursion to dispersion.
@
text
@d2 1
a2 1
$Header: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/drop_database.sgml,v 1.9 1999/12/12 05:15:09 momjian Exp $
d6 1
a6 1
<refentry id="SQL-DROPDATABASE" xreflabel="drop_database">
@


1.9
log
@Meanwhile, database names with single quotes in names don't work very well
at all, and because of shell quoting rules this can't be fixed, so I put
in error messages to that end.

Also, calling create or drop database in a transaction block is not so
good either, because the file system mysteriously refuses to roll back rm
calls on transaction aborts. :) So I put in checks to see if a transaction
is in progress and signal an error.

Also I put the whole call in a transaction of its own to be able to roll
back changes to pg_database in case the file system operations fail.

The alternative location issues I posted recently were untouched, awaiting
the outcome of that discussion. Other than that, this should be much more
fool-proof now.

The docs I cleaned up as well.

Peter Eisentraut                  Sernanders väg 10:115
@
text
@d2 1
a2 1
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/drop_database.sgml,v 1.8 1999/12/04 04:53:15 momjian Exp $
d94 1
a94 1
        You cannot be connected to the the database your are about to remove.
@


1.8
log
@New scripts for create/drop user/db from Peter Eisentraut
@
text
@d2 1
a2 1
$Header: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/drop_database.sgml,v 1.7 1999/08/06 13:50:30 thomas Exp $
d18 1
a18 1
   Destroys an existing database
d23 1
a23 1
   <date>1999-07-20</date>
d31 1
a31 1
    <date>1998-04-15</date>
d52 1
a52 1
    <date>1998-04-15</date>
d60 1
d62 1
a62 3
      <term><computeroutput>
DROP DATABASE
       </computeroutput></term>
d69 32
d102 1
a102 3
      <term><computeroutput>
WARN: destroydb: database "<replaceable class="parameter">name</replaceable>" does not exist.
       </computeroutput></term>
d109 20
d130 1
a130 3
      <term><computeroutput>
	ERROR:  destroydb cannot be executed on an open database
       </computeroutput></term>
d133 3
a135 1
	This message occurs if the specified database does not exist.
d139 1
d147 1
a147 1
   <date>1998-04-15</date>
d155 2
a156 2
   It can only be executed by the database administrator
   (See the <command>CREATE DATABASE</command> command for details).
d161 1
a161 1
    <date>1998-04-15</date>
d168 4
a171 4
    This query cannot be executed while connected to the target
    database. Thus, it might be more convenient to use
    <xref linkend="app-dropdb" endterm="app-dropdb-title">
    from the shell instead.
@


1.7
log
@Fix markup to allow clean man pages.
Add new pages for programming languages and tcl shells.
@
text
@d2 1
a2 1
$Header: /opt/postgres/cvs/pgsql/doc/src/sgml/ref/drop_database.sgml,v 1.6 1999/07/22 15:09:10 thomas Exp $
d62 1
a62 1
DESTROYDB
d119 3
a121 3
    database. It is usually preferable to use
    <xref linkend="app-destroydb" endterm="app-destroydb-title">
    instead.
a125 1
    <xref linkend="app-createdb" endterm="app-createdb-title"> and
@


1.6
log
@Complete merge of all old man page information.
ecpg reference page still needs formatting.
@
text
@d2 1
a2 1
$Header$
d6 1
a6 1
<refentry id="SQL-DROPDATABASE">
d120 1
a120 1
    <xref linkend="app-destroydb-title" endterm="app-destroydb-title">
d126 2
a127 2
    <xref linkend="app-createdb-title" endterm="app-createdb-title"> and
    <xref linkend="sql-createdatabase-title" endterm="sql-createdatabase-title">
@


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-04-15</date>
d118 4
a121 10
    <command>DROP DATABASE</command> statement is a <productname>Postgres</productname>
    language extension.

    <tip>
     <para>
      This query cannot be executed while connected to the target
      database. It is usually preferable to use the
      <command>destroydb</command> script instead.
     </para>
    </tip>
d125 4
a128 2
    Refer to the <command>CREATE DATABASE</command> statement for
    information on how to create a database.
a136 2
  <para>
  </para>
d145 1
d147 3
a149 1
    There is no <command>DROP DATABASE</command> in <acronym>SQL92</acronym>.
@


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-DROPDATABASE">
 <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 13
a28 13
 <REFSYNOPSISDIV>
  <REFSYNOPSISDIVINFO>
   <DATE>1998-04-15</DATE>
  </REFSYNOPSISDIVINFO>
  <SYNOPSIS>
DROP DATABASE <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE>
  </SYNOPSIS>
  
  <REFSECT2 ID="R2-SQL-DROPDATABASE-1">
   <REFSECT2INFO>
    <DATE>1998-04-15</DATE>
   </REFSECT2INFO>
   <TITLE>
d30 20
a49 22
   </TITLE>
   <PARA>
   </PARA>
       <VARIABLELIST>
	<VARLISTENTRY>
	 <TERM>
	  <ReturnValue><REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE></ReturnValue>
	 </TERM>
	 <LISTITEM>
	  <PARA>
          The name of an existing database to remove.
	  </PARA>
	 </LISTITEM>
	</VARLISTENTRY>
       </variablelist>
  </REFSECT2>
  
  <REFSECT2 ID="R2-SQL-DROPDATABASE-2">
   <REFSECT2INFO>
    <DATE>1998-04-15</DATE>
   </REFSECT2INFO>
   <TITLE>
d51 2
a52 2
   </TITLE>
   <PARA>
d54 18
a71 28
       <VARIABLELIST>
	<VARLISTENTRY>
	 <TERM>
	  <ReturnValue>DESTROYDB</ReturnValue>
	 </TERM>
	 <LISTITEM>
	  <PARA>
	   This message is returned if the command is successful.
	  </PARA>
	 </LISTITEM>
	</VARLISTENTRY>
	<VARLISTENTRY>
	 <TERM>
	  <ReturnValue>WARN: destroydb: database "<replaceable class="parameter">name</replaceable>" does not exist.</ReturnValue>
	 </TERM>
	 <LISTITEM>
	  <PARA>
	   This message occurs if the specified database does not exist.
	  </PARA>
	 </LISTITEM>
	</VARLISTENTRY>
	<VARLISTENTRY>
	 <TERM>
	  <ReturnValue>ERROR:  destroydb cannot be executed on an open database</ReturnValue>
	 </TERM>
	 <LISTITEM>
	  <PARA>
	   This message occurs if the specified database does not exist.
d75 11
a85 1
    </VARIABLELIST>
d87 2
a88 2
  </REFSECT2>
 </REFSYNOPSISDIV>
d90 5
a94 5
 <REFSECT1 ID="R1-SQL-DROPDATABASE-1">
  <REFSECT1INFO>
   <DATE>1998-04-15</DATE>
  </REFSECT1INFO>
  <TITLE>
d96 2
a97 2
  </TITLE>
  <PARA>
d102 7
a108 7
  </PARA>
  
  <REFSECT2 ID="R2-SQL-DROPDATABASE-3">
   <REFSECT2INFO>
    <DATE>1998-04-15</DATE>
   </REFSECT2INFO>
   <TITLE>
d110 1
a110 1
   </TITLE>
d113 2
a114 2
    DROP DATABASE statement is a <productname>Postgres</productname>
 language extension.
d119 2
a120 2
database. It is usually preferable to use the
 <command>destroydb</command> script instead.
d123 1
a124 1
   </para>
d130 4
a133 4
 </REFSECT1>
 
 <REFSECT1 ID="R1-SQL-DROPDATABASE-3">
  <TITLE>
d135 9
a143 9
  </TITLE>
  <PARA>
  </PARA>

  <REFSECT2 ID="R2-SQL-DROPDATABASE-4">
   <REFSECT2INFO>
    <DATE>1998-04-15</DATE>
   </REFSECT2INFO>
   <TITLE>
d145 4
a148 4
   </TITLE>
   <PARA>
   There is no <command>DROP DATABASE</command> in <acronym>SQL92</acronym>.
   </PARA>
d151 1
a151 1
</REFENTRY>
d156 1
a156 1
sgml-omittag:t
@


1.3
log
@Minor cleanup in markup, especially in the Output section.
@
text
@d15 1
d84 5
a88 2

   </VARIABLELIST>
@


1.2
log
@Editing and markup cleanup.
@
text
@d54 1
a54 8
   </PARA>
   <VARIABLELIST>
    <VARLISTENTRY>
     <TERM>
<replaceable>status</replaceable>
     </TERM>
     <LISTITEM>
      <PARA>
d83 1
a83 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
@d20 1
a20 1
   DROP DATABASE <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE>
a31 6
   <VARIABLELIST>
    <VARLISTENTRY>
     <TERM>
     </TERM>
     <LISTITEM>
      <PARA>
a43 3
     </LISTITEM>
    </VARLISTENTRY>
   </VARIABLELIST>
d58 1
d83 10
d121 6
a126 2
   <PARA>
    <warning>
d128 3
a130 2
      This query should NOT be executed interactively.
      The <command>destroydb</command> script should be used instead.
d132 2
a133 5
    </warning>
    <comment>Some explanation would be desirable here!</comment>
   </PARA>
   <para>
    DROP DATABASE statement is a PostgreSQL language extension.
d157 1
a157 1
   There is no DROP DATABASE statement in SQL92.
@
