- Docker Compose
- Run PostgreSQL container
docker compose up -d
- Enter PostgreSQL container
docker compose exec db bash
- Connect PostgreSQL REPL
docker compose exec db psql -d sample_db -U myuser
- Basic commands in PostgreSQL REPL
\du : show users
select current_user; : show current user
\l : show databases
\c : show current database
\d : show relations (tables) on specified database