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 -q
40
41 --quiet
42 Do not display a response.
43
44 dropuser also accepts the following command-line arguments for connec‐
45 tion parameters:
46
47 -h host
48
49 --host host
50 Specifies the host name of the machine on which the server is
51 running. If the value begins with a slash, it is used as the
52 directory for the Unix domain socket.
53
54 -p port
55
56 --port port
57 Specifies the TCP port or local Unix domain socket file exten‐
58 sion on which the server is listening for connections.
59
60 -U username
61
62 --username username
63 User name to connect as (not the user name to drop)
64
65 -W
66
67 --password
68 Force password prompt (to connect to the server, not for the
69 password of the user to be dropped).
70
72 PGHOST
73
74 PGPORT
75
76 PGUSER Default connection parameters
77
78 This utility, like most other PostgreSQL utilities, also uses the envi‐
79 ronment variables supported by libpq (see in the documentation).
80
82 In case of difficulty, see DROP ROLE [drop_role(7)] and psql(1) for
83 discussions of potential problems and error messages. The database
84 server must be running at the targeted host. Also, any default connec‐
85 tion settings and environment variables used by the libpq front-end
86 library will apply.
87
89 To remove user joe from the default database server:
90
91 $ dropuser joe
92 DROP ROLE
93
94
95 To remove user joe using the server on host eden, port 5000, with veri‐
96 fication and a peek at the underlying command:
97
98 $ dropuser -p 5000 -h eden -i -e joe
99 Role "joe" will be permanently removed.
100 Are you sure? (y/n) y
101 DROP ROLE "joe"
102 DROP ROLE
103
104
106 createuser(1), DROP ROLE [drop_role(7)]
107
108
109
110Application 2008-06-08 DROPUSER(1)