Skip to content

Instantly share code, notes, and snippets.

@sigilioso
Last active August 29, 2015 14:04
Show Gist options
  • Save sigilioso/dbbacd95a8cf1b6dac9a to your computer and use it in GitHub Desktop.
Save sigilioso/dbbacd95a8cf1b6dac9a to your computer and use it in GitHub Desktop.
Posgresql in memory for testing
#!/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