I need to create and delete tables in a test database while in development stage, but foreign keys verification bores me every time I need to erase its tables.
Is there any form to bypass this in Postgresql?
I've got it.
For a single table I can do:
DROP TABLE "tableName" CASCADE
For all tables inside a schema, for example "public", I can do:
DROP SCHEMA public CASCADE;
CREATE SCHEMA public;
Source:
http://www.postgresql.org/docs/current/static/sql-droptable.html
https://stackoverflow.com/a/13823560/937110
Or, as suggested by a_horse_with_no_name:
DROP OWNED BY name [, ...] [ CASCADE | RESTRICT ]
source: http://postgresql.org/docs/current/static/sql-drop-owned.html
drop owned by
that drop all objects owned by a user. Are you really still using Postgres 8.2?
delete
rows? Or do youdrop
the tables? It's unclear to me based on your question