2 $Header: /cvsroot/pgsql/doc/src/sgml/ref/dropuser.sgml,v 1.1 1999/12/04 04:53:15 momjian 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">. If you
105 need the <application>psql</application> options <literal>-U</literal> and
106 <literal>-W</literal> as well, you can uncomment the
107 respective lines in the source. They are disabled by default because of the potential
108 conceptual confusion between existing and new users.
112 <refsect2 id="R2-APP-DROPUSER-2">
114 <date>1999-11-07</date>
123 <term><computeroutput>DROP USER</computeroutput></term>
132 <term><computeroutput>dropuser: Deletion of user "<replaceable class="parameter">username</replaceable>" failed.</computeroutput></term>
135 Something went wrong. The user was not removed.
142 If there is an error condition, the backend error message will be displayed.
143 See <xref linkend="SQL-DROPUSER" endterm="SQL-DROPUSER-title">
144 and <xref linkend="APP-PSQL" endterm="APP-PSQL-title"> for possibilities.
149 <refsect1 id="R1-APP-DROPUSER-1">
151 <date>1999-11-07</date>
157 <application>dropuser</application> removes an existing
158 <productname>PostgreSQL</productname> user
159 <emphasis>and</emphasis> the databases which that user owned.
160 Only users with <literal>usesuper</literal> set in
161 the <literal>pg_shadow</literal> class can destroy
162 <productname>PostgreSQL</productname> users.
166 <application>dropuser</application> is a shell script wrapper around the
167 <acronym>SQL</acronym> command
168 <xref linkend="SQL-DROPUSER" endterm="SQL-DROPUSER-title"> via
169 the <productname>PostgreSQL</productname> interactive terminal
170 <xref linkend="APP-PSQL" endterm="APP-PSQL-title">. Thus, there is nothing
171 special about removing users via this or other methods. This means
172 that the <application>psql</application> must be found by the script and that
173 a database server is running at the targeted host. Also, any default
174 settings and environment variables available to <application>psql</application>
175 and the <application>libpq</application> front-end library do apply.
180 <refsect1 id="R1-APP-DROPUSER-2">
182 <date>1999-11-07</date>
188 To remove user <literal>joe</literal>
189 from the default database server:
191 $ <userinput>dropuser joe</userinput>
197 To remove user <literal>joe</literal>
198 using the postmaster on host eden, port 5000, with verification
199 and a peek at the underlying query:
201 $ <userinput>dropuser -p 5000 -h eden -i -e joe</userinput>
202 User "joe" and any owned databases will be permanently deleted.
203 Are you sure? (y/n) <userinput>y</userinput>
204 QUERY: DROP USER "joe"
212 <!-- Keep this comment at the end of the file
217 sgml-minimize-attributes:nil
218 sgml-always-quote-attributes:t
221 sgml-parent-document:nil
222 sgml-default-dtd-file:"../reference.ced"
223 sgml-exposed-tags:nil
224 sgml-local-catalogs:"/usr/lib/sgml/catalog"
225 sgml-local-ecat-files:nil