Skip to content

Instantly share code, notes, and snippets.

@slaveofcode
Created March 16, 2018 17:44
Show Gist options
  • Save slaveofcode/c5b18d90380e6c9381e7b8a75b08f4ae to your computer and use it in GitHub Desktop.
Save slaveofcode/c5b18d90380e6c9381e7b8a75b08f4ae to your computer and use it in GitHub Desktop.
Reset Postgres Database
# all of your tables are in a single schema, this approach could work (below code assumes that the name of your schema is public
DROP SCHEMA public CASCADE;
CREATE SCHEMA public;
# If you are using PostgreSQL 9.3 or greater, you may also need to restore the default grants.
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO public;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment