Skip to content

Instantly share code, notes, and snippets.

@fepa
Created September 11, 2013 04:35
Show Gist options
  • Save fepa/6519386 to your computer and use it in GitHub Desktop.
Save fepa/6519386 to your computer and use it in GitHub Desktop.
A snippet to drop in .bashrc to make life easier when restoring PostgreSQL dump files to a database on localhost.
function pglocal {
if [ "$1" = "" ]; then
echo "Run like this:"
echo "pglocal USER DATABASE PATH/TO/FILE"
else
pg_restore --verbose --clean --no-acl --no-owner -h localhost -$
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment