1
0

postgres.md 377 B

Postgres SQL

Tips for using Postgres SQL.

Use a database in a commandline

sudo service postgresql start ;
sudo -u postgres psql <db name> ;
sudo update-rc.d postgresql disable

Backup

Create backup profile :

CREATE ROLE backup WITH 
    NOSUPERUSER
    NOCREATEDB
    NOCREATEROLE 
    LOGIN
    PASSWORD 'IWantToBackUp';

Use \du to list roles.