Skip to content

Instantly share code, notes, and snippets.

@marcusvmsa
Created April 4, 2011 12:59
Show Gist options
  • Select an option

  • Save marcusvmsa/901590 to your computer and use it in GitHub Desktop.

Select an option

Save marcusvmsa/901590 to your computer and use it in GitHub Desktop.
vacuumdb --full --analyze --username postgres --dbname [DBNAME] --host [HOSTNAME]
pg_dump [DBNAME] -Ft -v -U postgres -f tmp/[DBNAME].tar --host [HOSTNAME]
dropdb [DBNAME] --username postgres --host [HOSTNAME]
createdb --encoding UTF8 [DBNAME] --username postgres --host [HOSTNAME] --template template0
pg_restore tmp/[DBNAME].tar | psql --dbname [DBNAME] --username postgres --host [HOSTNAME]
vacuumdb --full --analyze --username postgres --dbname [DBNAME] --host [HOSTNAME]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment