O'Reilly logo

Ubuntu Unleashed 2014 Edition: Covering 13.10 and 14.04,Ninth Edition by Paul Hudson, Andrew Hudson, Matthew Helmke

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Deleting Database Users in PostgreSQL

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:

matthew@seymour:~$  dropuser msmithDROP USER

You can also log in to your database by using psql and then use the DROP USER commands. Here is an example:

matthew@seymour:~$ psql demodbWelcome 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 quitdemodb=# DROP USER msmith ;DROP USERdemodb=# \q

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required