version 1, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
DROPUSER |
|
|
2 |
!!!DROPUSER |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
USAGE |
|
|
7 |
---- |
|
|
8 |
!!NAME |
|
|
9 |
|
|
|
10 |
|
|
|
11 |
dropuser - remove a PostgreSQL user account |
|
|
12 |
!!SYNOPSIS |
|
|
13 |
|
|
|
14 |
|
|
|
15 |
__dropuser__ [[ ''options''... ] [[ ''username'' |
|
|
16 |
] |
|
|
17 |
|
|
|
18 |
|
|
|
19 |
__INPUTS__ |
|
|
20 |
|
|
|
21 |
|
|
|
22 |
__-h, --host__ ''host'' |
|
|
23 |
|
|
|
24 |
|
|
|
25 |
Specifies the host name of the machine on which the server |
|
|
26 |
is running. If host begins with a slash, it is used as the |
|
|
27 |
directory for the Unix domain socket. |
|
|
28 |
|
|
|
29 |
|
|
|
30 |
__-p, --port__ ''port'' |
|
|
31 |
|
|
|
32 |
|
|
|
33 |
Specifies the Internet TCP/IP port or local Unix domain |
|
|
34 |
socket file extension on which the server is listening for |
|
|
35 |
connections. |
|
|
36 |
|
|
|
37 |
|
|
|
38 |
__-e, --echo__ |
|
|
39 |
|
|
|
40 |
|
|
|
41 |
Echo the queries that __createdb__ generates and sends to |
|
|
42 |
the server. |
|
|
43 |
|
|
|
44 |
|
|
|
45 |
__-q, --quiet__ |
|
|
46 |
|
|
|
47 |
|
|
|
48 |
Do not display a response. |
|
|
49 |
|
|
|
50 |
|
|
|
51 |
__-i, --interactive__ |
|
|
52 |
|
|
|
53 |
|
|
|
54 |
Prompt for confirmation before actually removing the |
|
|
55 |
user. |
|
|
56 |
|
|
|
57 |
|
|
|
58 |
''username'' |
|
|
59 |
|
|
|
60 |
|
|
|
61 |
Specifies the name of the PostgreSQL user to be removed. |
|
|
62 |
This name must exist in the PostgreSQL installation. You |
|
|
63 |
will be prompted for a name if none is specified on the |
|
|
64 |
command line. |
|
|
65 |
|
|
|
66 |
|
|
|
67 |
The options -h, -p, and -e, are passed on literally to |
|
|
68 |
psql(1). The __psql__ options -U and -W are |
|
|
69 |
available as well, but they can be confusing in this |
|
|
70 |
context. |
|
|
71 |
|
|
|
72 |
|
|
|
73 |
__OUTPUTS__ |
|
|
74 |
|
|
|
75 |
|
|
|
76 |
__DROP USER__ |
|
|
77 |
|
|
|
78 |
|
|
|
79 |
All is well. |
|
|
80 |
|
|
|
81 |
|
|
|
82 |
__dropuser: deletion of user |
|
|
83 |
__''username''____ |
|
|
84 |
|
|
|
85 |
|
|
|
86 |
Something went wrong. The user was not removed. |
|
|
87 |
|
|
|
88 |
|
|
|
89 |
If there is an error condition, the backend error message |
|
|
90 |
will be displayed. See DROP USER [[__drop_user__(l)] and |
|
|
91 |
psql(1) for possibilities. |
|
|
92 |
!!DESCRIPTION |
|
|
93 |
|
|
|
94 |
|
|
|
95 |
__dropuser__ removes an existing PostgreSQL user |
|
|
96 |
__and__ the databases which that user owned. Only users |
|
|
97 |
with usesuper set in the pg_shadow table can destroy |
|
|
98 |
PostgreSQL users. |
|
|
99 |
|
|
|
100 |
|
|
|
101 |
__dropuser__ is a shell script wrapper around the SQL |
|
|
102 |
command DROP USER [[__drop_user__(l)] via the PostgreSQL |
|
|
103 |
interactive terminal psql(1). Thus, there is nothing |
|
|
104 |
special about removing users via this or other methods. This |
|
|
105 |
means that the __psql__ must be found by the script and |
|
|
106 |
that a database server is running at the targeted host. |
|
|
107 |
Also, any default settings and environment variables |
|
|
108 |
available to __psql__ and the __libpq__ front-end |
|
|
109 |
library do apply. |
|
|
110 |
!!USAGE |
|
|
111 |
|
|
|
112 |
|
|
|
113 |
To remove user joe from the default database |
|
|
114 |
server: |
|
|
115 |
|
|
|
116 |
|
|
|
117 |
$ __dropuser joe |
|
|
118 |
__DROP USER |
|
|
119 |
|
|
|
120 |
|
|
|
121 |
To remove user joe using the postmaster on host eden, port |
|
|
122 |
5000, with verification and a peek at the underlying |
|
|
123 |
query: |
|
|
124 |
|
|
|
125 |
|
|
|
126 |
$ __dropuser -p 5000 -h eden -i -e joe |
|
|
127 |
__User |
|
|
128 |
__y |
|
|
129 |
__DROP USER |
|
|
130 |
__ |
|
|
131 |
---- |