- Install docker
https://docs.docker.com/get-docker/
- Install psql
# https://www.compose.com/articles/postgresql-tips-installing-the-postgresql-client/
brew install libpq
brew link --force libpq
- Run postrgres db in a docker container
# use docker to run a postgres db in a docker container
docker run --name postgres-blitz \
-e POSTGRES_USER=blitz \
-e POSTGRES_DB=blitz \
-e POSTGRES_PASSWORD=blitz \
-p 5432:5432 \
-d postgres
- Check the connection
# check the connection
psql postgresql://blitz:blitz@localhost:5432/blitz
psql (12.2)
Type "help" for help.
blitz=#\l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+-------+----------+------------+------------+-------------------
blitz | blitz | UTF8 | en_US.utf8 | en_US.utf8 |
postgres | blitz | UTF8 | en_US.utf8 | en_US.utf8 |
template0 | blitz | UTF8 | en_US.utf8 | en_US.utf8 | =c/blitz +
| | | | | blitz=CTc/blitz
template1 | blitz | UTF8 | en_US.utf8 | en_US.utf8 | =c/blitz +
| | | | | blitz=CTc/blitz
(4 rows)