Skip to content

Instantly share code, notes, and snippets.

@typetetris
Created November 6, 2020 10:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save typetetris/1fa8a371a1963c9e5871df3fce625903 to your computer and use it in GitHub Desktop.
Save typetetris/1fa8a371a1963c9e5871df3fce625903 to your computer and use it in GitHub Desktop.
#!/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 liquibase.properties
# 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