Reputation:
I followed this tutorial and made a typo where I was supposed to create a user for my django apps to connect as;
I was supposed to run su - postgres -c "createuser www-data -P"
but I ran su - postgres -c "createuser www-dtata -P"
.
I dont want to proceed until I remove that user, which I don't know the command for. I found and tried DROP USER
after searching around, but the terminal returned -su: DROP: command not found
.
Upvotes: 4
Views: 14399
Reputation: 1
sudo su
su - postgres -c "dropuser www-dtata"
Upvotes: -1
Reputation: 2513
You can use dropuser
console tool (see https://www.postgresql.org/docs/current/static/app-dropuser.html):
su - postgres -c "dropuser www-dtata"
Or use DROP USER
SQL query (see https://www.postgresql.org/docs/current/static/sql-dropuser.html):
sudo -u postgres psql -c 'DROP USER "www-dtata";'
These 2 approaches do the same thing. In SQL version, you also need to use double quotes around DB user name, due to -
in it.
Upvotes: 2