How can I drop all tables in PostgreSQL, working from the command line?
I don't want to drop the database itself, just all tables and all the data in them.
If you are going to restore dump on this db, then
pg_restore --clean can do it for you.
--clean Before restoring database objects, issue commands to DROP all the objects that will be restored. This option is useful for overwriting an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported, unless --if-exists is also specified.
Maybe the simplest way is:
Drop database contains that tables with:
drop database DATABASE_NAME;
Recreate that database:
create database DATABASE_NAME;