How to generate drop cascade with pg_dump

From: Emi Lu <emilu(at)encs(dot)concordia(dot)ca>
To: PostgreSQL SQL List <pgsql-sql(at)postgresql(dot)org>
Subject: How to generate drop cascade with pg_dump
Date: 2013-01-08 21:53:56
Message-ID: 50EC9574.9060500@encs.concordia.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello,

May I know how to generate drop table cascade when pg_dump a schema please?

E.g.,
pg_dump -h db_server -E UTF8 -n schema_name -U schema_owner --clean
-d db_name >! ~/a.dmp

In a.dmp, I'd like to get:

drop table t1 cascade;
drop table t2 cascade;
... ...

Only dropping constraints within a schema is not good enough since there
are dependencies on other schema.

Thanks a lot!
Emi

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Adrian Klaver 2013-01-09 16:52:04 Re: How to generate drop cascade with pg_dump
Previous Message Adrian Klaver 2013-01-08 15:25:25 Re: copy users/groups