Created
September 13, 2016 02:13
-
-
Save lamogura/2e0553e453602a4daca31d4e971cd7b6 to your computer and use it in GitHub Desktop.
drop all tables in postgres db
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
| psql -h <pg_host> -p <pg_port> -U <pg_user> <pg_db> -t -c "select 'drop table \"' || tablename || '\" cascade;' from pg_tables where schemaname='public'" | psql -h <pg_host> -p <pg_port> -U <pg_user> <pg_db> | |
| // remember to have the password set in .pgpass file, host:port:db:user:pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment