run postgres in docker
docker run -it --rm --name pg -e POSTGRES_PASSWORD=pgp -e POSTGRES_USER=pgu -e POSTGRES_DB=pgdb -p 5432:5432 postgres
connect to postgres from psql:
PGPASSWORD=pgp psql --dbname pgdb --host=localhost --username=pgu
run postgres in docker
docker run -it --rm --name pg -e POSTGRES_PASSWORD=pgp -e POSTGRES_USER=pgu -e POSTGRES_DB=pgdb -p 5432:5432 postgres
connect to postgres from psql:
PGPASSWORD=pgp psql --dbname pgdb --host=localhost --username=pgu