Re: Cascade view drop permission checks - Mailing list pgsql-general

From David G. Johnston
Subject Re: Cascade view drop permission checks
Date
Msg-id CAKFQuwZPe4fy7HcG=nc4uYXV9M8saX5bZpPoam0Bn_6Sq_BsfA@mail.gmail.com
Whole thread Raw
In response to Re: Cascade view drop permission checks  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Wed, Apr 6, 2022 at 6:48 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
(b) what other behavior would be better?  Dropping the table and
leaving a broken view behind isn't good.  Neither is refusing to
let the owner drop her object.


CREATE OR REPLACE VIEW name
SELECT null::type, null::type, null::type;

Where the column count and types allow the "OR REPLACE" behavior to work.

Now the owner of the view can put an alternate implementation in place, and the lack of a delete on the view prevents further cascading.

It has its flaws and benefits, but so does having objects drop.  I suppose if we did have this kind of behavior we'd probably also have a way to inform the system that, basically, there are no select privileges (or some other spelling of "invalid") on the view, so any attempt to query the view would fail even while the view still exists.

David J.

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Cascade view drop permission checks
Next
From: Adrian Klaver
Date:
Subject: Re: PostgreSQL 10.20 crashes / Antivirus