File: app-dropuser.html

package info (click to toggle)
pgadmin3 1.4.3-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 29,796 kB
  • ctags: 10,758
  • sloc: cpp: 55,356; sh: 6,164; ansic: 1,520; makefile: 576; sql: 482; xml: 100; perl: 18
file content (148 lines) | stat: -rw-r--r-- 8,165 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>dropuser</title>
<link rel="stylesheet" href="stylesheet.css" type="text/css">
<link rev="made" href="pgsql-docs@postgresql.org">
<meta name="generator" content="DocBook XSL Stylesheets V1.70.0">
<link rel="start" href="index.html" title="PostgreSQL 8.1.4 Documentation">
<link rel="up" href="reference-client.html" title="PostgreSQL Client Applications">
<link rel="prev" href="app-droplang.html" title="droplang">
<link rel="next" href="app-ecpg.html" title="ecpg">
<link rel="copyright" href="ln-legalnotice.html" title="Legal Notice">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
<a name="app-dropuser"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>dropuser &#8212; remove a <span class="productname">PostgreSQL</span> user account</p>
</div>
<a name="id794835"></a><div class="refsynopsisdiv">
<h2>Synopsis</h2>
<div class="cmdsynopsis"><p><code class="command">dropuser</code> [<em class="replaceable"><code>option</code></em>...] [<em class="replaceable"><code>username</code></em>]</p></div>
</div>
<div class="refsect1" lang="en">
<a name="id794872"></a><h2>Description</h2>
<p>   <span class="application">dropuser</span> removes an existing
   <span class="productname">PostgreSQL</span> user.
   Only superusers and users with the <code class="literal">CREATEROLE</code> privilege can
   remove <span class="productname">PostgreSQL</span> users.  (To remove a
   superuser, you must yourself be a superuser.)
  </p>
<p>   <span class="application">dropuser</span> is a wrapper around the
   <acronym class="acronym">SQL</acronym> command <a href="sql-droprole.html">DROP ROLE</a>.
   There is no effective difference between dropping users via
   this utility and via other methods for accessing the server.
  </p>
</div>
<div class="refsect1" lang="en">
<a name="id794934"></a><h2>Options</h2>
<p>   <span class="application">dropuser</span> accepts the following command-line arguments:

    </p>
<div class="variablelist"><dl>
<dt><span class="term"><em class="replaceable"><code>username</code></em></span></dt>
<dd><p>        Specifies the name of the <span class="productname">PostgreSQL</span> user to be removed. 
        You will be prompted for a name if none is specified on the command line.
       </p></dd>
<dt>
<span xmlns="http://www.w3.org/TR/xhtml1/transitional" class="term"><code xmlns="" class="option">-e</code></span><br xmlns="http://www.w3.org/TR/xhtml1/transitional"></br><span class="term"><code class="option">--echo</code></span>
</dt>
<dd><p>        Echo the commands that <span class="application">dropuser</span> generates
        and sends to the server.
       </p></dd>
<dt>
<span xmlns="http://www.w3.org/TR/xhtml1/transitional" class="term"><code xmlns="" class="option">-i</code></span><br xmlns="http://www.w3.org/TR/xhtml1/transitional"></br><span class="term"><code class="option">--interactive</code></span>
</dt>
<dd><p>        Prompt for confirmation before actually removing the user.
       </p></dd>
<dt>
<span xmlns="http://www.w3.org/TR/xhtml1/transitional" class="term"><code xmlns="" class="option">-q</code></span><br xmlns="http://www.w3.org/TR/xhtml1/transitional"></br><span class="term"><code class="option">--quiet</code></span>
</dt>
<dd><p>        Do not display a response.
       </p></dd>
</dl></div>
<p>
  </p>
<p>   <span class="application">dropuser</span> also accepts the following
   command-line arguments for connection parameters:
    
   </p>
<div class="variablelist"><dl>
<dt>
<span xmlns="http://www.w3.org/TR/xhtml1/transitional" class="term"><code xmlns="" class="option">-h <em class="replaceable"><code>host</code></em></code></span><br xmlns="http://www.w3.org/TR/xhtml1/transitional"></br><span class="term"><code class="option">--host <em class="replaceable"><code>host</code></em></code></span>
</dt>
<dd><p>        Specifies the host name of the machine on which the 
        server
        is running.  If the value begins with a slash, it is used 
        as the directory for the Unix domain socket.
       </p></dd>
<dt>
<span xmlns="http://www.w3.org/TR/xhtml1/transitional" class="term"><code xmlns="" class="option">-p <em class="replaceable"><code>port</code></em></code></span><br xmlns="http://www.w3.org/TR/xhtml1/transitional"></br><span class="term"><code class="option">--port <em class="replaceable"><code>port</code></em></code></span>
</dt>
<dd><p>        Specifies the TCP port or local Unix domain socket file 
        extension on which the server
        is listening for connections.
       </p></dd>
<dt>
<span xmlns="http://www.w3.org/TR/xhtml1/transitional" class="term"><code xmlns="" class="option">-U <em class="replaceable"><code>username</code></em></code></span><br xmlns="http://www.w3.org/TR/xhtml1/transitional"></br><span class="term"><code class="option">--username <em class="replaceable"><code>username</code></em></code></span>
</dt>
<dd><p>        User name to connect as (not the user name to drop)
       </p></dd>
<dt>
<span xmlns="http://www.w3.org/TR/xhtml1/transitional" class="term"><code xmlns="" class="option">-W</code></span><br xmlns="http://www.w3.org/TR/xhtml1/transitional"></br><span class="term"><code class="option">--password</code></span>
</dt>
<dd><p>        Force password prompt (to connect to the server, not for the
        password of the user to be dropped).
       </p></dd>
</dl></div>
<p>
  </p>
</div>
<div class="refsect1" lang="en">
<a name="id795122"></a><h2>Environment</h2>
<div class="variablelist"><dl>
<dt>
<span xmlns="http://www.w3.org/TR/xhtml1/transitional" class="term"><code xmlns="" class="envar">PGHOST</code></span><br xmlns="http://www.w3.org/TR/xhtml1/transitional"></br><span xmlns="http://www.w3.org/TR/xhtml1/transitional" class="term"><code xmlns="" class="envar">PGPORT</code></span><br xmlns="http://www.w3.org/TR/xhtml1/transitional"></br><span class="term"><code class="envar">PGUSER</code></span>
</dt>
<dd><p>      Default connection parameters
     </p></dd>
</dl></div>
</div>
<div class="refsect1" lang="en">
<a name="id795144"></a><h2>Diagnostics</h2>
<p>   In case of difficulty, see <a href="sql-droprole.html">DROP ROLE</a> and <a href="app-psql.html" title="psql"><span class="refentrytitle"><a name="app-psql-title"></a><span class="application">psql</span></span></a> for
   discussions of potential problems and error messages.
   The database server must be running at the
   targeted host.  Also, any default connection settings and environment
   variables used by the <span class="application">libpq</span> front-end
   library will apply.
  </p>
</div>
<div class="refsect1" lang="en">
<a name="id795179"></a><h2>Examples</h2>
<p>    To remove user <code class="literal">joe</code> from the default database
    server:
</p>
<pre class="screen"><code class="prompt">$ </code><strong class="userinput"><code>dropuser joe</code></strong>
<code class="computeroutput">DROP ROLE</code></pre>
<p>
   </p>
<p>    To remove user <code class="literal">joe</code> using the server on host
    <code class="literal">eden</code>, port 5000, with verification and a peek at the underlying
    command:
</p>
<pre class="screen"><code class="prompt">$ </code><strong class="userinput"><code>dropuser -p 5000 -h eden -i -e joe</code></strong>
<code class="computeroutput">Role "joe" will be permanently removed.
Are you sure? (y/n) </code><strong class="userinput"><code>y</code></strong>
<code class="computeroutput">DROP ROLE "joe"
DROP ROLE</code></pre>
<p>
   </p>
</div>
<div class="refsect1" lang="en">
<a name="id795265"></a><h2>See Also</h2>
<span class="simplelist"><a href="app-createuser.html" title="createuser"><span class="refentrytitle"><a name="app-createuser-title"></a><span class="application">createuser</span></span></a>, <a href="sql-droprole.html">DROP ROLE</a>, Environment Variables (<a href="libpq-envars.html" title="28.11.Environment Variables">Section28.11, &#8220;Environment Variables&#8221;</a>)</span>
</div>
</div></body>
</html>