Re: FK cascade delete permissions Q

From: Wells Oliver <wells(dot)oliver(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: FK cascade delete permissions Q
Date: 2021-01-29 19:14:36
Message-ID: CAOC+FBXfMu2YX6KpDYsgSMSBCNbbo1AoaN3+5hM6EQ+zsTnyuQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Ah, doh, thank you. Of course that's it.

On Fri, Jan 29, 2021 at 11:12 AM David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Fri, Jan 29, 2021 at 11:57 AM Wells Oliver <wells(dot)oliver(at)gmail(dot)com>
> wrote:
>
>> I have a user who created a table B with an FK constraint to table A with
>> CASCADE DELETE, but receives a permission denied error on A.
>>
>> It seems odd to me. The FK constraint is not deleting from A, it's
>> ensuring a delete from B, for which the user has permission.
>>
>> What am I missing?
>>
>>
> Has nothing to do with the choice to specify cascade delete.
>
> The documentation for references says:
>
> The user must have REFERENCES permission on the referenced table (either
> the whole table, or the specific referenced columns).
>
> Without such permissions a record in B would present a denial of service
> on the ability to remove a record from table A by a user without any
> permissions on table A.
>
> David J.
>
>

--
Wells Oliver
wells(dot)oliver(at)gmail(dot)com <wellsoliver(at)gmail(dot)com>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Omkar Dhorge 2021-01-30 19:34:05 Schema Restore Issue
Previous Message David G. Johnston 2021-01-29 19:12:05 Re: FK cascade delete permissions Q