Skip to content

Instantly share code, notes, and snippets.

@gbpereira
Last active January 10, 2018 01:47
Show Gist options
  • Save gbpereira/c50ed5728cdc6a2cd009f62dd99a0317 to your computer and use it in GitHub Desktop.
Save gbpereira/c50ed5728cdc6a2cd009f62dd99a0317 to your computer and use it in GitHub Desktop.
# instalando postgres e dependências
sudo apt-get install postgresql postgresql-contrib postgresql-server-dev-9.5
# acessando o postgres
sudo su - postgres
psql
# alterando o encoding que vem por padrão
update pg_database set encoding = 6, datcollate = 'pt_BR.UTF-8', datctype = 'pt_BR.UTF-8' where datname = 'postgres';
update pg_database set encoding = 6, datcollate = 'pt_BR.UTF-8', datctype = 'pt_BR.UTF-8' where datname = 'template0';
update pg_database set encoding = 6, datcollate = 'pt_BR.UTF-8', datctype = 'pt_BR.UTF-8' where datname = 'template1';
# criando role e database para o usuario
create role username superuser login;
create database username;
# criando uma role para o projeto
create role project_name with createdb superuser login password 'senhasenha';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment