Re: Undocumented behavior od DROP SCHEMA ... CASCADE

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Vik Fearing <vik(at)2ndquadrant(dot)fr>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, denisa(dot)cirstescu(at)asentinel(dot)com, "pgsql-docs(at)postgresql(dot)org" <pgsql-docs(at)postgresql(dot)org>
Subject: Re: Undocumented behavior od DROP SCHEMA ... CASCADE
Date: 2016-08-12 21:32:05
Message-ID: 20160812213205.GA717717@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Tom Lane wrote:
> Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> > I think it'd be a good idea to add some more discoverability: what would
> > be deleted if an object X were to be deleted?
>
> There's plenty of discoverability already. The documentation suggests
>
> (If you want to check what <command>DROP ... CASCADE</> will do,
> run <command>DROP</> without <literal>CASCADE</> and read the
> <literal>DETAIL</> output.)
>
> Or you could do BEGIN; DROP ... CASCADE; ROLLBACK.

True, but the DETAIL is capped at 100 objects (per
reportDependentObjects); also, object locks need to be acquired, which
can be very troublesome if you discover that some frequently-used object
is in the set to be dropped, by some unfortunate accident.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2016-08-12 22:01:37 Re: Undocumented behavior od DROP SCHEMA ... CASCADE
Previous Message Tom Lane 2016-08-12 21:01:27 Re: Undocumented behavior od DROP SCHEMA ... CASCADE