Re: Bug on drop extension dependencies ?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Marcos Pegoraro <marcos(at)f10(dot)com(dot)br>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug on drop extension dependencies ?
Date: 2025-07-12 18:41:03
Message-ID: CAKFQuwbQQMzj9_=TXMh9SCVSvXEmY8zfX1MPbdq3-DkuxbcPgQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jul 12, 2025 at 11:31 AM Marcos Pegoraro <marcos(at)f10(dot)com(dot)br> wrote:

> --If I use client_min_messages = notice I'll receive a hint that the
> exception is being dropped. But I didn't read that because I want to drop
> everything on that schema, but only on that schema.
>
> mydb=# set client_min_messages = warning;
> SET
> mydb=# drop schema ten_1 cascade;
> DROP SCHEMA
>
> 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:

"Using the CASCADE option might make the command remove objects in other
schemas besides the one(s) named."

Probably should have made the extension owned by a superuser and schemas
owned by some less-privileged user so that couldn't happen. Or just give
the extension its own schema.

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-07-12 19:07:42 Re: Bug on drop extension dependencies ?
Previous Message David E. Wheeler 2025-07-12 18:31:48 Re: ABI Compliance Checker GSoC Project