RRua
12/2/2017 - 7:09 PM

Quict start Postgres

create cluster, dbase and connect to db

postgres





criar pasta para o cluster
mkdir databases/postgres; cd tothat
# criar cluster para o user ruirua
initdb -U username -D folder 
# iniciar server( ir para o folder
 pg_ctl -D . -l logfile start #MAC OS
#criar db
createdb demo
# conectar
psql -d demo [-U username]

[sudo su - _postgres] #MAC OS dscl . list /Users
psql postgres
CREATE DATABASE myproject;
CREATE USER myprojectuser WITH PASSWORD 'password';
CREATE USER myprojectuser WITH PASSWORD 'password';
\q