Re: `DROP DATABASE RESTRICT` ?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Brennan Vincent <brennan(at)materialize(dot)io>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>, Nikhil Benesch <benesch(at)materialize(dot)io>
Subject: Re: `DROP DATABASE RESTRICT` ?
Date: 2020-03-05 01:23:46
Message-ID: CAKFQuwYzpDpkLdhC28FUbt1K4MPF=qr+CQs4EUPbZNA=TTb72w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Mar 4, 2020 at 6:17 PM Brennan Vincent <brennan(at)materialize(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2020-03-05 01:28:20 Re: Performance Problem
Previous Message Ravi Krishna 2020-03-05 00:27:12 Re: Determining the type of an obkect in plperl