Skip to content

Instantly share code, notes, and snippets.

@rondy
Last active September 27, 2024 13:44
Show Gist options
  • Save rondy/0acef2f99c777d530d25ff41a467d855 to your computer and use it in GitHub Desktop.
Save rondy/0acef2f99c777d530d25ff41a467d855 to your computer and use it in GitHub Desktop.

acessar console do Postgres com root

psql postgres

criar novo usuario com persmissão de criação de database

CREATE USER rondy WITH PASSWORD 'rondy'; ALTER USER rondy CREATEDB;

criar novo database

CREATE DATABASE my_db;
GRANT ALL PRIVILEGES ON DATABASE my_db to rondy;

mostrar a porta pra conexão do Banco

SHOW port;

após rodar migrations do django...

acessar o banco de dados

psql -U rondy -d my_db

listar todas as tabelas

\dt

exibir detalhes (schema) de uma tabela

\d proposal_proposal;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment