PostgreSQL is a great database engine, especially when used with Django.
In this simple tutorial we will
-
Create a USER
CREATE USER johnnybravo WITH PASSWORD 'bulletproof';
-
Create a DATABASE
CREATE DATABASE johnnybase;
-
Give the USER full access to the DATABASE
GRANT ALL PRIVILEGES ON DATABASE johnnybase to johnnybravo;
That's it! Your terminal should look like
faisal@vps:~$ sudo su postgres
postgres@vps:~$ psql
psql (9.4.1)
Type "help" for help.
postgres=# CREATE USER johnnybravo WITH PASSWORD 'bulletproof';
CREATE ROLE
postgres=# CREATE DATABASE johnnybase;
CREATE DATABASE
postgres=# GRANT ALL PRIVILEGES ON DATABASE johnnybase to johnnybravo;
GRANT
postgres=# \q