Created
March 16, 2018 17:44
-
-
Save slaveofcode/c5b18d90380e6c9381e7b8a75b08f4ae to your computer and use it in GitHub Desktop.
Reset Postgres Database
This file contains hidden or 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
# 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