Skip to content

Instantly share code, notes, and snippets.

@matuu
Last active July 8, 2016 15:30
Show Gist options
  • Save matuu/1b9f4e11c0dea6190255 to your computer and use it in GitHub Desktop.
Save matuu/1b9f4e11c0dea6190255 to your computer and use it in GitHub Desktop.
Postgres, create user & db
Option 1
su - postgres
psql template1
CREATE USER tom WITH PASSWORD 'myPassword';
CREATE DATABASE jerry;
GRANT ALL PRIVILEGES ON DATABASE jerry to tom;
Option 2:
su postgres
postgres@debian: createuser tom
postgres@debian: createdb jerry
psql template1
\password tom
GRANT ALL PRIVILEGES ON DATABASE jerry to tom;
import
postgres@mimaquina $ psql jerry < dumpfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment