These commands are for linux/Mac, changes will need to made if you are running this in Microsoft Windows.
Docker is installed psql client is installed
-
Pull Docker Image
docker pull postgres -
Build data directory
mkdir -p ~/srv/postgres -
Run docker image
docker run --rm --name lil-postgres -e POSTGRES_PASSWORD=password -d -v $HOME/srv/postgres:/var/lib/postgresql/data -p 5432:5432 postgres
docker stop lil-postgres
psql -h localhost -U postgres -d hplussport
psql -h localhost -U postgres -f database.sqlpsql -h localhost -U postgres -d hplussport -f customer.sqlpsql -h localhost -U postgres -d hplussport -f product.sqlpsql -h localhost -U postgres -d hplussport -f salesperson.sqlpsql -h localhost -U postgres -d hplussport -f orders.sql