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

From David G. Johnston
Subject Re: Bug on drop extension dependencies ?
Date
Msg-id CAKFQuwbQQMzj9_=TXMh9SCVSvXEmY8zfX1MPbdq3-DkuxbcPgQ@mail.gmail.com
Whole thread Raw
In response to Bug on drop extension dependencies ?  (Marcos Pegoraro <marcos@f10.com.br>)
Responses Re: Bug on drop extension dependencies ?
List pgsql-hackers
On Sat, Jul 12, 2025 at 11:31 AM Marcos Pegoraro <marcos@f10.com.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.

pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: ABI Compliance Checker GSoC Project
Next
From: Tom Lane
Date:
Subject: Re: Bug on drop extension dependencies ?