2 $Header: /cvsroot/pgsql/doc/src/sgml/ref/dropuser.sgml,v 1.5 2000/11/11 23:01:45 petere Exp $
6 <refentry id="APP-DROPUSER">
8 <date>2000-11-11</date>
12 <refentrytitle id="APP-DROPUSER-TITLE"><application>dropuser</application></refentrytitle>
13 <manvolnum>1</manvolnum>
14 <refmiscinfo>Application</refmiscinfo>
18 <refname>dropuser</refname>
19 <refpurpose>Drops (removes) a <productname>Postgres</productname> user</refpurpose>
24 <command>dropuser</command>
25 <arg rep="repeat"><replaceable>options</replaceable></arg>
26 <arg><replaceable>username</replaceable></arg>
29 <refsect2 id="R2-APP-DROPUSER-1">
37 <term>-h, --host <replaceable class="parameter">host</replaceable></term>
40 Specifies the hostname of the machine on which the
41 <application>postmaster</application>
48 <term>-p, --port <replaceable class="parameter">port</replaceable></term>
51 Specifies the Internet TCP/IP port or local Unix domain socket file
52 extension on which the <application>postmaster</application>
53 is listening for connections.
59 <term>-e, --echo</term>
62 Echo the queries that <application>createdb</application> generates
63 and sends to the backend.
69 <term>-q, --quiet</term>
72 Do not display a response.
78 <term>-i, --interactive</term>
81 Prompt for confirmation before actually removing the user.
87 <term><replaceable class="parameter">username</replaceable></term>
90 Specifies the name of the <productname>Postgres</productname> user to be removed.
91 This name must exist in the <productname>Postgres</productname> installation.
92 You will be prompted for a name if none is specified on the command line.
100 The options <literal>-h</literal>, <literal>-p</literal>, and <literal>-e</literal>,
101 are passed on literally to <xref linkend="APP-PSQL" endterm="APP-PSQL-title">. The
102 <application>psql</application> options <literal>-U</literal> and <literal>-W</literal>
103 are available as well, but they can be confusing in this context.
107 <refsect2 id="R2-APP-DROPUSER-2">
115 <term><computeroutput>DROP USER</computeroutput></term>
124 <term><computeroutput>dropuser: deletion of user "<replaceable class="parameter">username</replaceable>" failed</computeroutput></term>
127 Something went wrong. The user was not removed.
134 If there is an error condition, the backend error message will be displayed.
135 See <xref linkend="SQL-DROPUSER" endterm="SQL-DROPUSER-title">
136 and <xref linkend="APP-PSQL" endterm="APP-PSQL-title"> for possibilities.
141 <refsect1 id="R1-APP-DROPUSER-1">
146 <application>dropuser</application> removes an existing
147 <productname>Postgres</productname> user
148 <emphasis>and</emphasis> the databases which that user owned.
149 Only users with <literal>usesuper</literal> set in
150 the <literal>pg_shadow</literal> class can destroy
151 <productname>Postgres</productname> users.
155 <application>dropuser</application> is a shell script wrapper around the
156 <acronym>SQL</acronym> command
157 <xref linkend="SQL-DROPUSER" endterm="SQL-DROPUSER-title"> via
158 the <productname>Postgres</productname> interactive terminal
159 <xref linkend="APP-PSQL" endterm="APP-PSQL-title">. Thus, there is nothing
160 special about removing users via this or other methods. This means
161 that the <application>psql</application> must be found by the script and that
162 a database server is running at the targeted host. Also, any default
163 settings and environment variables available to <application>psql</application>
164 and the <application>libpq</application> front-end library do apply.
169 <refsect1 id="R1-APP-DROPUSER-2">
174 To remove user <literal>joe</literal> from the default database
177 <prompt>$ </prompt><userinput>dropuser joe</userinput>
178 <computeroutput>DROP USER</computeroutput>
185 To remove user <literal>joe</literal> using the postmaster on host
186 eden, port 5000, with verification and a peek at the underlying
189 <prompt>$ </prompt><userinput>dropuser -p 5000 -h eden -i -e joe</userinput>
190 <computeroutput>User "joe" and any owned databases will be permanently deleted.
191 Are you sure? (y/n) </computeroutput><userinput>y</userinput>
192 <computeroutput>DROP USER "joe"
193 DROP USER</computeroutput>
201 <!-- Keep this comment at the end of the file
206 sgml-minimize-attributes:nil
207 sgml-always-quote-attributes:t
210 sgml-parent-document:nil
211 sgml-default-dtd-file:"../reference.ced"
212 sgml-exposed-tags:nil
213 sgml-local-catalogs:"/usr/lib/sgml/catalog"
214 sgml-local-ecat-files:nil