Re: Bug on drop extension dependencies ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Marcos Pegoraro <marcos(at)f10(dot)com(dot)br>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug on drop extension dependencies ?
Date: 2025-07-12 19:07:42
Message-ID: 138820.1752347262@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Sat, Jul 12, 2025 at 11:31 AM Marcos Pegoraro <marcos(at)f10(dot)com(dot)br> wrote:
>> I don't know how to fix it, but I think it's a bug.

> You told it to cascade and it will happily remove anything within the
> database to comply. It is not a bug. The docs even make that point
> explicitly:

Indeed. If we put a restriction on this case then we'd just need to
invent a "REALLY CASCADE" option that did the more aggressive thing.

In any case, AFAICS the SQL spec says what CASCADE means, and this
is what it means. There's no intermediate step between RESTRICT
(don't drop any dependent objects) and CASCADE (drop every directly
or indirectly dependent object).

I grant that there could sometimes be a use for intermediate levels of
aggressiveness, but it's hard to see exactly where to draw the line
that wouldn't be extremely application-specific.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-07-12 19:14:44 Re: Adding support for SSLKEYLOGFILE in the frontend
Previous Message David G. Johnston 2025-07-12 18:41:03 Re: Bug on drop extension dependencies ?