2 $Header: /cvsroot/pgsql/doc/src/sgml/ref/dropuser.sgml,v 1.3 2000/01/12 19:36:34 petere Exp $
6 <refentry id="APP-DROPUSER">
8 <refentrytitle id="APP-DROPUSER-TITLE">
9 <application>dropuser</application>
11 <refmiscinfo>Application</refmiscinfo>
15 <application>dropuser</application>
18 Drops (removes) a <productname>Postgres</productname> user
23 <date>1999-11-07</date>
26 dropuser [ <replaceable class="parameter">options</replaceable> ] [ <replaceable class="parameter">username</replaceable> ]
29 <refsect2 id="R2-APP-DROPUSER-1">
31 <date>1999-11-07</date>
40 <term>-h, --host <replaceable class="parameter">host</replaceable></term>
43 Specifies the hostname of the machine on which the
44 <application>postmaster</application>
51 <term>-p, --port <replaceable class="parameter">port</replaceable></term>
54 Specifies the Internet TCP/IP port or local Unix domain socket file
55 extension on which the <application>postmaster</application>
56 is listening for connections.
62 <term>-e, --echo</term>
65 Echo the queries that <application>createdb</application> generates
66 and sends to the backend.
72 <term>-q, --quiet</term>
75 Do not display a response.
81 <term>-i, --interactive</term>
84 Prompt for confirmation before actually removing the user.
90 <term><replaceable class="parameter">username</replaceable></term>
93 Specifies the name of the <productname>PostgreSQL</productname> user to be removed.
94 This name must exist in the <productname>Postgres</productname> installation.
95 You will be prompted for a name if none is specified on the command line.
103 The options <literal>-h</literal>, <literal>-p</literal>, and <literal>-e</literal>,
104 are passed on literally to <xref linkend="APP-PSQL" endterm="APP-PSQL-title">. The
105 <application>psql</application> options <literal>-U</literal> and <literal>-W</literal>
106 are available as well, but they can be confusing in this context.
110 <refsect2 id="R2-APP-DROPUSER-2">
112 <date>1999-11-07</date>
121 <term><computeroutput>DROP USER</computeroutput></term>
130 <term><computeroutput>dropuser: deletion of user "<replaceable class="parameter">username</replaceable>" failed</computeroutput></term>
133 Something went wrong. The user was not removed.
140 If there is an error condition, the backend error message will be displayed.
141 See <xref linkend="SQL-DROPUSER" endterm="SQL-DROPUSER-title">
142 and <xref linkend="APP-PSQL" endterm="APP-PSQL-title"> for possibilities.
147 <refsect1 id="R1-APP-DROPUSER-1">
149 <date>1999-11-07</date>
155 <application>dropuser</application> removes an existing
156 <productname>PostgreSQL</productname> user
157 <emphasis>and</emphasis> the databases which that user owned.
158 Only users with <literal>usesuper</literal> set in
159 the <literal>pg_shadow</literal> class can destroy
160 <productname>PostgreSQL</productname> users.
164 <application>dropuser</application> is a shell script wrapper around the
165 <acronym>SQL</acronym> command
166 <xref linkend="SQL-DROPUSER" endterm="SQL-DROPUSER-title"> via
167 the <productname>PostgreSQL</productname> interactive terminal
168 <xref linkend="APP-PSQL" endterm="APP-PSQL-title">. Thus, there is nothing
169 special about removing users via this or other methods. This means
170 that the <application>psql</application> must be found by the script and that
171 a database server is running at the targeted host. Also, any default
172 settings and environment variables available to <application>psql</application>
173 and the <application>libpq</application> front-end library do apply.
178 <refsect1 id="R1-APP-DROPUSER-2">
180 <date>1999-11-07</date>
186 To remove user <literal>joe</literal>
187 from the default database server:
189 $ <userinput>dropuser joe</userinput>
195 To remove user <literal>joe</literal>
196 using the postmaster on host eden, port 5000, with verification
197 and a peek at the underlying query:
199 $ <userinput>dropuser -p 5000 -h eden -i -e joe</userinput>
200 User "joe" and any owned databases will be permanently deleted.
201 Are you sure? (y/n) <userinput>y</userinput>
210 <!-- Keep this comment at the end of the file
215 sgml-minimize-attributes:nil
216 sgml-always-quote-attributes:t
219 sgml-parent-document:nil
220 sgml-default-dtd-file:"../reference.ced"
221 sgml-exposed-tags:nil
222 sgml-local-catalogs:"/usr/lib/sgml/catalog"
223 sgml-local-ecat-files:nil