Re: Bug on drop extension dependencies ? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Bug on drop extension dependencies ?
Date
Msg-id 269091.1752419987@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bug on drop extension dependencies ?  (Marcos Pegoraro <marcos@f10.com.br>)
List pgsql-hackers
Marcos Pegoraro <marcos@f10.com.br> writes:
> I understand that it's not possible to prevent DROP ... CASCADE from
> executing. However, the subsequent deletion of constraints, triggers, or
> functions will affect the behavior of other schemas, so I think it's
> reasonable to at least explicitly state in the log which objects were
> deleted due to that command.

[ shrug... ]  We do report that.  For example:

regression=# create table t1(f1 int primary key);
CREATE TABLE
regression=# create table t2(f2 int references t1);
CREATE TABLE
regression=# drop table t1;
ERROR:  cannot drop table t1 because other objects depend on it
DETAIL:  constraint t2_f2_fkey on table t2 depends on table t1
HINT:  Use DROP ... CASCADE to drop the dependent objects too.
regression=# drop table t1 cascade;
NOTICE:  drop cascades to constraint t2_f2_fkey on table t2
DROP TABLE

At default log settings, the ERROR/DETAIL would appear in the log,
while the NOTICE would not.  Either way, there is plenty of
opportunity to observe what will or did get dropped.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Florents Tselai
Date:
Subject: Re: add function for creating/attaching hash table in DSM registry
Next
From: Zhang Mingli
Date:
Subject: Re: [Question] Window Function Results without ORDER BY Clause