Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#!/usr/bin/env bash
set -e
mkdir -p sandbox/db
initdb --auth=trust --auth-host=trust --auth-local=trust --pgdata=sandbox/db --encoding="UTF-8" --locale=C --username dev
echo "unix_socket_directories = '.'" >> sandbox/db/postgresql.conf
echo "port = 5431" >> sandbox/db/postgresql.conf
pg_ctl -w -D sandbox/db -l sandbox/dblogfile start
createdb -h localhost -p 5431 -U dev -w -E UTF-8 -l C -O dev dev
pg_ctl -D sandbox/db stop -m s
# using url=jdbc:postgresql://localhost:5431/dev in
# using "host=localhost port=5431 user=dev dbname=dev" as connect string in some haskell program
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment