1DROPUSER(1) PostgreSQL Client Applications DROPUSER(1)
2
3
4
6 dropuser - remove a PostgreSQL user account
7
8
10 dropuser [ option... ] [ username ]
11
13 dropuser removes an existing PostgreSQL user. Only superusers and
14 users with the CREATEROLE privilege can remove PostgreSQL users. (To
15 remove a superuser, you must yourself be a superuser.)
16
17 dropuser is a wrapper around the SQL command DROP ROLE [drop_role(7)].
18 There is no effective difference between dropping users via this util‐
19 ity and via other methods for accessing the server.
20
22 dropuser accepts the following command-line arguments:
23
24 username
25 Specifies the name of the PostgreSQL user to be removed. You
26 will be prompted for a name if none is specified on the command
27 line.
28
29 -e
30
31 --echo Echo the commands that dropuser generates and sends to the
32 server.
33
34 -i
35
36 --interactive
37 Prompt for confirmation before actually removing the user.
38
39 dropuser also accepts the following command-line arguments for connec‐
40 tion parameters:
41
42 -h host
43
44 --host host
45 Specifies the host name of the machine on which the server is
46 running. If the value begins with a slash, it is used as the
47 directory for the Unix domain socket.
48
49 -p port
50
51 --port port
52 Specifies the TCP port or local Unix domain socket file exten‐
53 sion on which the server is listening for connections.
54
55 -U username
56
57 --username username
58 User name to connect as (not the user name to drop).
59
60 -w
61
62 --no-password
63 Never issue a password prompt. If the server requires password
64 authentication and a password is not available by other means
65 such as a .pgpass file, the connection attempt will fail. This
66 option can be useful in batch jobs and scripts where no user is
67 present to enter a password.
68
69 -W
70
71 --password
72 Force dropuser to prompt for a password before connecting to a
73 database.
74
75 This option is never essential, since dropuser will automati‐
76 cally prompt for a password if the server demands password
77 authentication. However, dropuser will waste a connection
78 attempt finding out that the server wants a password. In some
79 cases it is worth typing -W to avoid the extra connection
80 attempt.
81
83 PGHOST
84
85 PGPORT
86
87 PGUSER Default connection parameters
88
89 This utility, like most other PostgreSQL utilities, also uses the envi‐
90 ronment variables supported by libpq (see in the documentation).
91
93 In case of difficulty, see DROP ROLE [drop_role(7)] and psql(1) for
94 discussions of potential problems and error messages. The database
95 server must be running at the targeted host. Also, any default connec‐
96 tion settings and environment variables used by the libpq front-end
97 library will apply.
98
100 To remove user joe from the default database server:
101
102 $ dropuser joe
103
104
105 To remove user joe using the server on host eden, port 5000, with veri‐
106 fication and a peek at the underlying command:
107
108 $ dropuser -p 5000 -h eden -i -e joe
109 Role "joe" will be permanently removed.
110 Are you sure? (y/n) y
111 DROP ROLE joe;
112
113
115 createuser(1), DROP ROLE [drop_role(7)]
116
117
118
119Application 2011-09-22 DROPUSER(1)