3 .\" Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
6 .\" Manual: PostgreSQL 18.0 Documentation
7 .\" Source: PostgreSQL 18.0
10 .TH "DROPUSER" "1" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 dropuser \- remove a PostgreSQL user account
33 .HP \w'\fBdropuser\fR\ 'u
34 \fBdropuser\fR [\fIconnection\-option\fR...] [\fIoption\fR...] [\fIusername\fR]
40 user\&. Superusers can use this command to remove any role; otherwise, only non\-superuser roles can be removed, and only by a user who possesses the
42 privilege and has been granted
47 is a wrapper around the
50 \fBDROP ROLE\fR\&. There is no effective difference between dropping users via this utility and via other methods for accessing the server\&.
54 accepts the following command\-line arguments:
58 Specifies the name of the
60 user to be removed\&. You will be prompted for a name if none is specified on the command line and the
61 \fB\-i\fR/\fB\-\-interactive\fR
69 Echo the commands that
71 generates and sends to the server\&.
78 Prompt for confirmation before actually removing the user, and prompt for the user name if none is specified on the command line\&.
92 Do not throw an error if the user does not exist\&. A notice is issued in this case\&.
101 command line arguments, and exit\&.
105 also accepts the following command\-line arguments for connection parameters:
107 \fB\-h \fR\fB\fIhost\fR\fR
109 \fB\-\-host=\fR\fB\fIhost\fR\fR
111 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\&.
114 \fB\-p \fR\fB\fIport\fR\fR
116 \fB\-\-port=\fR\fB\fIport\fR\fR
118 Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections\&.
121 \fB\-U \fR\fB\fIusername\fR\fR
123 \fB\-\-username=\fR\fB\fIusername\fR\fR
125 User name to connect as (not the user name to drop)\&.
130 \fB\-\-no\-password\fR
132 Never issue a password prompt\&. If the server requires password authentication and a password is not available by other means such as a
134 file, the connection attempt will fail\&. This option can be useful in batch jobs and scripts where no user is present to enter a password\&.
143 to prompt for a password before connecting to a database\&.
145 This option is never essential, since
147 will automatically prompt for a password if the server demands password authentication\&. However,
149 will waste a connection attempt finding out that the server wants a password\&. In some cases it is worth typing
151 to avoid the extra connection attempt\&.
161 Default connection parameters
166 Specifies whether to use color in diagnostic messages\&. Possible values are
173 This utility, like most other
175 utilities, also uses the environment variables supported by
181 In case of difficulty, see
182 DROP ROLE (\fBDROP_ROLE\fR(7))
185 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
187 front\-end library will apply\&.
192 from the default database server:
206 using the server on host
207 eden, port 5000, with verification and a peek at the underlying command:
213 $ \fBdropuser \-p 5000 \-h eden \-i \-e joe\fR
214 Role "joe" will be permanently removed\&.
215 Are you sure? (y/n) \fBy\fR
222 \fBcreateuser\fR(1), DROP ROLE (\fBDROP_ROLE\fR(7))