Re: DROP CASCADE transitive dependencies

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: C GG <cgg0007(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: DROP CASCADE transitive dependencies
Date: 2018-12-03 20:32:36
Message-ID: 20181203203236.3snshir7dwwpi7mh@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2018-Dec-03, C GG wrote:

> data=# begin;
> BEGIN
> data=# DROP SCHEMA blah CASCADE;
> NOTICE: drop cascades to 278 other objects
> DETAIL: drop cascades to type blah.timeclock_compute_hours_type
> ...
> and 178 other objects (see server log for list)
> data=# rollback;
> ROLLBACK
> data=#
>
> and I can't see any of the other 178 objects in the server log. I did see
> all the deadlock reports because I had left the transaction hanging open
> while I went rubbernecking. ;) Maybe my log level isn't detailed enough.

If you do DROP without cascade, the objects are going to be listed
in the DETAIL field of the ERROR, so you need to have
log_error_verbosity set to verbose or default; if you have it as terse,
they won't appear in the server log.

If you DROP with CASCADE, the objects would appear in a NOTICE message,
which may be below your log_min_messages. Try with
SET LOCAL log_min_messages TO notice;
in the same transaction, just before the drop.

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Igor Korot 2018-12-03 21:53:48 Re: How to watch for schema changes
Previous Message Pavel Stehule 2018-12-03 19:38:58 Re: DROP CASCADE transitive dependencies