SP/web2py/scripts/drop-pgsql-tables.sh
Saturneic 064f602b1a Add.
2018-10-25 23:33:13 +08:00

14 lines
293 B
Bash

# first, login with psql
psql -U USERNAME -d databasename
# set output for all queries
\o FILENAME.sql
# run this query
select 'drop table ' || tablename || ' cascade;' from pg_tables;
# logout from psql
\q
# run sql script from commandline
psql -U USERNAME -d databasename -f FILENAME.sql