To delete a database user, you use the dropuser command, along with the user's name, and the user's access is removed from the default database, like this:
$ dropuser msmith
You can also log in to your database by using psqi and then use the drop user commands. Here's an example:
$ psql demodb
Welcome to psql, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms \h for help with SQL commands \? for help on internal slash commands \g or terminate with semicolon to execute query \q to quit demodb=# DROP USER msmith ; DROP USER
Was this article helpful?