]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/dropuser.sgml
Fixed a few "fixes" and bugs. Adjusted messages and options to GNU suggestions.
[postgresql] / doc / src / sgml / ref / dropuser.sgml
1 <!--
2 $Header: /cvsroot/pgsql/doc/src/sgml/ref/dropuser.sgml,v 1.3 2000/01/12 19:36:34 petere Exp $
3 Postgres documentation
4 -->
5
6 <refentry id="APP-DROPUSER">
7  <refmeta>
8   <refentrytitle id="APP-DROPUSER-TITLE">
9    <application>dropuser</application>
10   </refentrytitle>
11   <refmiscinfo>Application</refmiscinfo>
12  </refmeta>
13  <refnamediv>
14   <refname>
15    <application>dropuser</application>
16   </refname>
17   <refpurpose>
18    Drops (removes) a <productname>Postgres</productname> user
19   </refpurpose>
20  </refnamediv>
21  <refsynopsisdiv>
22   <refsynopsisdivinfo>
23    <date>1999-11-07</date>
24   </refsynopsisdivinfo>
25   <synopsis>
26 dropuser [ <replaceable class="parameter">options</replaceable> ] [ <replaceable class="parameter">username</replaceable> ]
27   </synopsis>
28
29   <refsect2 id="R2-APP-DROPUSER-1">
30    <refsect2info>
31     <date>1999-11-07</date>
32    </refsect2info>
33    <title>
34     Inputs
35    </title>
36    <para>
37
38     <variablelist>
39      <varlistentry>
40       <term>-h, --host <replaceable class="parameter">host</replaceable></term>
41       <listitem>
42        <para>
43         Specifies the hostname of the machine on which the 
44         <application>postmaster</application>
45         is running.
46        </para>
47       </listitem>
48      </varlistentry>
49
50      <varlistentry>
51       <term>-p, --port <replaceable class="parameter">port</replaceable></term>
52       <listitem>
53        <para>
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.
57        </para>
58       </listitem>
59      </varlistentry>
60
61      <varlistentry>
62       <term>-e, --echo</term>
63       <listitem>
64        <para>
65         Echo the queries that <application>createdb</application> generates
66         and sends to the backend.
67        </para>
68       </listitem>
69      </varlistentry>
70
71      <varlistentry>
72       <term>-q, --quiet</term>
73       <listitem>
74        <para>
75         Do not display a response.
76        </para>
77       </listitem>
78      </varlistentry>
79
80      <varlistentry>
81       <term>-i, --interactive</term>
82       <listitem>
83        <para>
84         Prompt for confirmation before actually removing the user.
85        </para>
86       </listitem>
87      </varlistentry>
88
89      <varlistentry>
90       <term><replaceable class="parameter">username</replaceable></term>
91       <listitem>
92        <para>
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.
96        </para>
97       </listitem>
98      </varlistentry>
99     </variablelist>
100     </para>
101
102     <para>
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.
107    </para>
108   </refsect2>
109
110   <refsect2 id="R2-APP-DROPUSER-2">
111    <refsect2info>
112     <date>1999-11-07</date>
113    </refsect2info>
114    <title>
115     Outputs
116    </title>
117
118    <para>
119     <variablelist>
120      <varlistentry>
121       <term><computeroutput>DROP USER</computeroutput></term>
122       <listitem>
123        <para>
124         All is well.
125        </para>
126       </listitem>
127      </varlistentry>
128
129      <varlistentry>
130       <term><computeroutput>dropuser: deletion of user "<replaceable class="parameter">username</replaceable>" failed</computeroutput></term>
131       <listitem>
132        <para>
133         Something went wrong. The user was not removed.
134        </para>
135       </listitem>
136      </varlistentry>
137
138     </variablelist>
139
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.
143    </para>
144   </refsect2>
145  </refsynopsisdiv>
146
147  <refsect1 id="R1-APP-DROPUSER-1">
148   <refsect1info>
149    <date>1999-11-07</date>
150   </refsect1info>
151   <title>
152    Description
153   </title>
154   <para>
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.
161   </para>
162
163   <para>
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.
174   </para>
175
176  </refsect1>
177
178  <refsect1 id="R1-APP-DROPUSER-2">
179   <refsect1info>
180    <date>1999-11-07</date>
181   </refsect1info>
182   <title>
183    Usage
184   </title>
185   <para>
186    To remove user <literal>joe</literal>
187    from the default database server:
188    <programlisting>
189 $ <userinput>dropuser joe</userinput>
190 DROP USER
191    </programlisting>
192   </para>
193
194   <para>
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:
198    <programlisting>
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>
202 DROP USER "joe"
203 DROP USER
204    </programlisting>
205   </para>
206  </refsect1>
207
208 </refentry>
209
210 <!-- Keep this comment at the end of the file
211 Local variables:
212 mode: sgml
213 sgml-omittag:nil
214 sgml-shorttag:t
215 sgml-minimize-attributes:nil
216 sgml-always-quote-attributes:t
217 sgml-indent-step:1
218 sgml-indent-data: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
224 End:
225 -->