1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
|
<!-- manual page source format generated by PolyglotMan v3.0.4, -->
<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
<HTML>
<HEAD>
<TITLE>DESTROYDB(UNIX) manual page</TITLE>
</HEAD>
<BODY>
<A HREF="pgsql.html">PostgreSQL Contents</A>
<H2><A NAME="sect0" HREF="#toc0">NAME </A></H2>
destroydb - destroy an existing database
<H2><A NAME="sect1" HREF="#toc1">SYNOPSIS </A></H2>
<B>destroydb</B> [<B>-i</B>]
[<B>-a</B> system] [<B>-h</B> host] [<B>-p</B> port] [dbname]
<H2><A NAME="sect2" HREF="#toc2">DESCRIPTION </A></H2>
<I>Destroydb</I> destroys
an existing database. To execute this command, the user must be the database
administrator, or DBA, for this database. The program runs silently; no
confirmation message will be displayed. After the database is destroyed,
a Unix shell prompt will reappear. <P>
<I>Destroydb</I> is a shell script that invokes
<I>psql</I>. Hence, a <I>postmaster</I> process must be running on the database server
host before <I>destroydb</I> is executed. In addition, the <FONT SIZE=-1>PGOPTION</FONT>
and <FONT SIZE=-1>PGREALM</FONT>
environment variables will be passed on to <I>psql</I> and processed as described
in <I><A HREF="psql.1.html">psql</I>(1)</A>
. <P>
The optional argument <I>dbname</I> specifies the name of the database
to be destroyed. All references to the database are removed, including
the directory containing this database and its associated files. <I>Dbname</I>
defaults to the value of the <FONT SIZE=-1>USER</FONT>
environment variable. <P>
<I>Destroydb</I> understands
the following command-line options:
<DL>
<DT><B>-i</B> </DT>
<DD>Prompts before destroying a database
(interactive). </DD>
<DT><B>-a</B> system </DT>
<DD>Specifies an authentication system <I>system</I> (see
<I><A HREF="pgintro.1.html">pgintro</I>(1)</A>
) to use in connecting to the <I>postmaster</I> process. This option
no longer has any effect. </DD>
<DT><B>-h</B> host </DT>
<DD>Specifies the hostname of the machine
on which the <I>postmaster</I> is running. Defaults to using local Unix domain
sockets. </DD>
<DT><B>-p</B> port </DT>
<DD>Specifies the TCP/IP port or local Unix domain socket
file extension on which the <I>postmaster</I> is listening for connections. Defaults
to 5432, or the value of the <FONT SIZE=-1>PGPORT</FONT>
environment variable (if set). </DD>
</DL>
<H2><A NAME="sect3" HREF="#toc3">EXAMPLES
</A></H2>
# destroy the demo database <BR>
destroydb demo <BR>
# destroy the demo database
using the postmaster on host eden, port 5000. <BR>
destroydb -p 5000 -h eden
demo <BR>
<H2><A NAME="sect4" HREF="#toc4">FILES </A></H2>
<DL>
<DT>$PGDATA/base/<I>dbname </I> </DT>
<DD>The location of the files corresponding
to the database <I>dbname</I>. </DD>
</DL>
<H2><A NAME="sect5" HREF="#toc5">SEE ALSO </A></H2>
<A HREF="destroydb.l.html">destroydb(l)</A>
, <A HREF="createdb.1.html">createdb(1)</A>
, <A HREF="initdb.1.html">initdb(1)</A>
,
<A HREF="psql.1.html">psql(1)</A>
. <A HREF="postmaster.1.html">postmaster(1)</A>
.
<H2><A NAME="sect6" HREF="#toc6">DIAGNOSTICS </A></H2>
<DL>
<DT><B>Error: Failed to connect to backend
(host=</B><I>xxx</I><B>, port=</B><I>xxx</I><B>)</B> </DT>
<DD><I>Destroydb</I> could not attach to the <I>postmaster</I> process
on the specified host and port. If you see this message, ensure that the
<I>postmaster</I> is running on the proper host and that you have specified the
proper port. If your site uses an authentication system, ensure that you
have obtained the required authentication credentials. </DD>
<DT><B>user `</B><I>username</I><B>' is
not in `pg_user'</B> </DT>
<DD>You do not have a valid entry in the relation `pg_user'
and cannot do anything with Postgres at all; contact your Postgres site
administrator. </DD>
<DT><B>user `</B><I>username</I><B>' is not allowed to create/destroy databases</B>
</DT>
<DD>You do not have permission to destroy databases; contact your Postgres
site administrator. </DD>
<DT><B>database `dbname' does not exist</B> </DT>
<DD>The database to be
removed does not have an entry in the `pg_database' class. </DD>
<DT><B>database `</B><I>dbname</I><B>'
is not owned by you</B> </DT>
<DD>You are not DBA for the specified database. </DD>
<DT><B>database
destroy failed on</B><I> dbname</I> </DT>
<DD>An internal error occurred in <I>psql</I> or the backend
server. Contact your Postgres site administrator to ensure that ensure
that the files and database entries associated with the database are completely
removed. </DD>
</DL>
<P>
<HR><P>
<A NAME="toc"><B>Table of Contents</B></A><P>
<UL>
<LI><A NAME="toc0" HREF="#sect0">NAME</A></LI>
<LI><A NAME="toc1" HREF="#sect1">SYNOPSIS</A></LI>
<LI><A NAME="toc2" HREF="#sect2">DESCRIPTION</A></LI>
<LI><A NAME="toc3" HREF="#sect3">EXAMPLES</A></LI>
<LI><A NAME="toc4" HREF="#sect4">FILES</A></LI>
<LI><A NAME="toc5" HREF="#sect5">SEE ALSO</A></LI>
<LI><A NAME="toc6" HREF="#sect6">DIAGNOSTICS</A></LI>
</UL>
</BODY></HTML>
|