Last active
August 29, 2015 14:04
-
-
Save sigilioso/dbbacd95a8cf1b6dac9a to your computer and use it in GitHub Desktop.
Posgresql in memory for testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
service postgresql stop | |
TMPDIR=/tmp/tmp_psql | |
MOUNTPOINT=/var/lib/postgresql | |
mount -t tmpfs -o size=512M,nr_inodes=10k,mode=0777 tmpfs $TMPDIR | |
rsync --archive $MOUNTPOINT/ $TMPDIR/ | |
mount -o bind $TMPDIR $MOUNTPOINT | |
service postgresql start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment