DROPUSER(1)
π
dropuser β remove a PostgreSQL user account (DROPUSER(1)) π
okay so bestie, this is the dropuser page from the PostgreSQL 14.24 docs, and weβre gonna make it make sense. itβs giving βbye-bye, user accountβ energy, and honestly? iconic. π
β¨ NAME β¨
dropuser β remove a PostgreSQL user account
πΈ SYNOPSIS πΈ
dropuser [connection-option...] [option...] [username]
π¦ DESCRIPTION π¦
dropuser removes an existing PostgreSQL user. Only superusers and users with the CREATEROLE privilege can remove PostgreSQL users. (To remove a superuser, you must yourself be a superuser.) π
dropuser is a wrapper around the SQL command DROP ROLE. There is no effective difference between dropping users via this utility and via other methods for accessing the server. fr fr, itβs the same vibe under the hood. π«
π OPTIONS π
dropuser accepts the following command-line arguments:
usernameβ Specifies the name of the PostgreSQL user to be removed. You will be prompted for a name if none is specified on the command line and the-i/--interactiveoption is used. π«Ά-e,--echoβ Echo the commands thatdropusergenerates and sends to the server. not me wanting to see the receipts π-i,--interactiveβ Prompt for confirmation before actually removing the user, and prompt for the user name if none is specified on the command line. bestie check before you wreck π₯-V,--versionβ Print thedropuserversion and exit.--if-existsβ Do not throw an error if the user does not exist. A notice is issued in this case. lowkey forgiving π-?,--helpβ Show help aboutdropusercommand line arguments, and exit.
dropuser also accepts the following command-line arguments for connection parameters:
-h host,--host=hostβ 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. path vibes π°οΈ-p port,--port=portβ Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.-U username,--username=usernameβ User name to connect as (not the user name to drop). important distinction, bestie π¨-w,--no-passwordβ Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a.pgpassfile, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password. automated queen behavior π€-W,--passwordβ Forcedropuserto prompt for a password before connecting to a database.
This option is never essential, since dropuser will automatically prompt for a password if the server demands password authentication. However, dropuser will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt. honestly? efficient π
π ENVIRONMENT π
PGHOST,PGPORT,PGUSERβ Default connection parameters.PG_COLORβ Specifies whether to use color in diagnostic messages. Possible values arealways,autoandnever.
This utility, like most other PostgreSQL utilities, also uses the environment variables supported by libpq (see Section 34.15). iykyk π§
π DIAGNOSTICS π
In case of difficulty, see DROP ROLE (DROP_ROLE(7)) and psql(1) 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 libpq front-end library will apply. no cap, check the server first π
π EXAMPLES π
To remove user joe from the default database server:
$ dropuser joe
To remove user joe using the server on host eden, port 5000, with verification and a peek at the underlying command:
$ dropuser -p 5000 -h eden -i -e joe
Role "joe" will be permanently removed.
Are you sure? (y/n) y
DROP ROLE joe;
π SEE ALSO π
createuser(1)DROP ROLE (DROP_ROLE(7))
π okay thatβs the whole page, bestie β PostgreSQL 14.24, 2026, DROPUSER(1) signing off π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms