commands.sh

dropuser

all

Remove an existing PostgreSQL user (role).

More info →

Options (4)

-i, --interactiveboolean

Prompt for confirmation and the username before user removal

Example: dropuser {{[-i|--interactive]}}
-h, --hostboolean

Remove a user on the server with address 127.0.0.1 on port 4321

Example: dropuser {{[-h|--host]}} 127.0.0.1 {{[-p|--port]}} 4321 {{username}}
-p, --portboolean

Remove a user on the server with address 127.0.0.1 on port 4321

Example: dropuser {{[-h|--host]}} 127.0.0.1 {{[-p|--port]}} 4321 {{username}}
-U, --usernameboolean

Remove a user on the server with address 127.0.0.1 on port 4321 as user "admin"

Example: dropuser {{[-U|--username]}} admin {{[-h|--host]}} 127.0.0.1 {{[-p|--port]}} 4321 {{username}}

Examples (5)

Prompt for confirmation and the username before user removal

dropuser [-i|--interactive]

Remove user instantly

dropuser username

No error if the user to be removed doesn't exist

dropuser --if-exists username

Remove a user on the server with address 127.0.0.1 on port 4321

dropuser [-h|--host] 127.0.0.1 [-p|--port] 4321 username

Remove a user on the server with address 127.0.0.1 on port 4321 as user "admin"

dropuser [-U|--username] admin [-h|--host] 127.0.0.1 [-p|--port] 4321 username
made by @shridhargupta | data from tldr-pages