Re: `DROP DATABASE RESTRICT` ? - Mailing list pgsql-general

From David G. Johnston
Subject Re: `DROP DATABASE RESTRICT` ?
Date
Msg-id CAKFQuwYzpDpkLdhC28FUbt1K4MPF=qr+CQs4EUPbZNA=TTb72w@mail.gmail.com
Whole thread Raw
In response to `DROP DATABASE RESTRICT` ?  (Brennan Vincent <brennan@materialize.io>)
List pgsql-general
On Wed, Mar 4, 2020 at 6:17 PM Brennan Vincent <brennan@materialize.io> wrote:
Hello all,

I was wondering if there is some reason why Postgres doesn't support a
`RESTRICT` option that would refuse to drop a database if it contains
any schemas or objects, similarly to the semantics of `DROP SCHEMA
[...] RESTRICT`.

Is there a fundamental reason not to support it, or is it just that
nobody has implemented it yet?

Fundamentally you are not connected to the database you are dropping and so don't have access to the knowledge of whether its populated or not.  It also likely has at least an empty public schema...

David J.

pgsql-general by date:

Previous
From: "Ravi Krishna"
Date:
Subject: Re: Determining the type of an obkect in plperl
Next
From: "David G. Johnston"
Date:
Subject: Re: Performance Problem