Re: Cascade view drop permission checks

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "m7onov(at)gmail(dot)com" <m7onov(at)gmail(dot)com>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Cascade view drop permission checks
Date: 2022-04-06 14:20:31
Message-ID: CAKFQuwZPe4fy7HcG=nc4uYXV9M8saX5bZpPoam0Bn_6Sq_BsfA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Apr 6, 2022 at 6:48 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2022-04-06 14:41:51 Re: PostgreSQL 10.20 crashes / Antivirus
Previous Message Tom Lane 2022-04-06 13:48:41 Re: Cascade view drop permission checks