]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/dropuser.sgml
Markup enhancements, some factual corrections.
[postgresql] / doc / src / sgml / ref / dropuser.sgml
1 <!--
2 $Header: /cvsroot/pgsql/doc/src/sgml/ref/dropuser.sgml,v 1.5 2000/11/11 23:01:45 petere Exp $
3 Postgres documentation
4 -->
5
6 <refentry id="APP-DROPUSER">
7  <docinfo>
8   <date>2000-11-11</date>
9  </docinfo>
10
11  <refmeta>
12   <refentrytitle id="APP-DROPUSER-TITLE"><application>dropuser</application></refentrytitle>
13   <manvolnum>1</manvolnum>
14   <refmiscinfo>Application</refmiscinfo>
15  </refmeta>
16
17  <refnamediv>
18   <refname>dropuser</refname>
19   <refpurpose>Drops (removes) a <productname>Postgres</productname> user</refpurpose>
20  </refnamediv>
21
22  <refsynopsisdiv>
23   <cmdsynopsis>
24    <command>dropuser</command>
25    <arg rep="repeat"><replaceable>options</replaceable></arg>
26    <arg><replaceable>username</replaceable></arg>
27   </cmdsynopsis>
28
29   <refsect2 id="R2-APP-DROPUSER-1">
30    <title>
31     Inputs
32    </title>
33    <para>
34
35     <variablelist>
36      <varlistentry>
37       <term>-h, --host <replaceable class="parameter">host</replaceable></term>
38       <listitem>
39        <para>
40         Specifies the hostname of the machine on which the 
41         <application>postmaster</application>
42         is running.
43        </para>
44       </listitem>
45      </varlistentry>
46
47      <varlistentry>
48       <term>-p, --port <replaceable class="parameter">port</replaceable></term>
49       <listitem>
50        <para>
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.
54        </para>
55       </listitem>
56      </varlistentry>
57
58      <varlistentry>
59       <term>-e, --echo</term>
60       <listitem>
61        <para>
62         Echo the queries that <application>createdb</application> generates
63         and sends to the backend.
64        </para>
65       </listitem>
66      </varlistentry>
67
68      <varlistentry>
69       <term>-q, --quiet</term>
70       <listitem>
71        <para>
72         Do not display a response.
73        </para>
74       </listitem>
75      </varlistentry>
76
77      <varlistentry>
78       <term>-i, --interactive</term>
79       <listitem>
80        <para>
81         Prompt for confirmation before actually removing the user.
82        </para>
83       </listitem>
84      </varlistentry>
85
86      <varlistentry>
87       <term><replaceable class="parameter">username</replaceable></term>
88       <listitem>
89        <para>
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.
93        </para>
94       </listitem>
95      </varlistentry>
96     </variablelist>
97     </para>
98
99     <para>
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.
104    </para>
105   </refsect2>
106
107   <refsect2 id="R2-APP-DROPUSER-2">
108    <title>
109     Outputs
110    </title>
111
112    <para>
113     <variablelist>
114      <varlistentry>
115       <term><computeroutput>DROP USER</computeroutput></term>
116       <listitem>
117        <para>
118         All is well.
119        </para>
120       </listitem>
121      </varlistentry>
122
123      <varlistentry>
124       <term><computeroutput>dropuser: deletion of user "<replaceable class="parameter">username</replaceable>" failed</computeroutput></term>
125       <listitem>
126        <para>
127         Something went wrong. The user was not removed.
128        </para>
129       </listitem>
130      </varlistentry>
131
132     </variablelist>
133
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.
137    </para>
138   </refsect2>
139  </refsynopsisdiv>
140
141  <refsect1 id="R1-APP-DROPUSER-1">
142   <title>
143    Description
144   </title>
145   <para>
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.
152   </para>
153
154   <para>
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.
165   </para>
166
167  </refsect1>
168
169  <refsect1 id="R1-APP-DROPUSER-2">
170   <title>Usage</title>
171
172   <informalexample>
173    <para>
174     To remove user <literal>joe</literal> from the default database
175     server:
176 <screen>
177 <prompt>$ </prompt><userinput>dropuser joe</userinput>
178 <computeroutput>DROP USER</computeroutput>
179 </screen>
180    </para>
181   </informalexample>
182
183   <informalexample>
184    <para>
185     To remove user <literal>joe</literal> using the postmaster on host
186     eden, port 5000, with verification and a peek at the underlying
187     query:
188 <screen>
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>
194 </screen>
195    </para>
196   </informalexample>
197  </refsect1>
198
199 </refentry>
200
201 <!-- Keep this comment at the end of the file
202 Local variables:
203 mode: sgml
204 sgml-omittag:nil
205 sgml-shorttag:t
206 sgml-minimize-attributes:nil
207 sgml-always-quote-attributes:t
208 sgml-indent-step:1
209 sgml-indent-data: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
215 End:
216 -->