No docs for interaction of ON DELETE/UPDATE and permissions

From: David Glasser <glasser(at)apollographql(dot)com>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: No docs for interaction of ON DELETE/UPDATE and permissions
Date: 2020-02-24 22:45:21
Message-ID: CAOz3Odt1+vuFZvKoHuOT6N1nOAgJdhY7HpF5zsxUe18_B2qB=w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

I was planning to add a new table TA only writable by user A, with a
foreign key reference with ON DELETE CASCADE to another table TB only
writable by user B. My hope was that user B would still be allowed to
delete rows in TB and cause cascading deletions in table TA, and some
manual investigation makes it seem like that is the implemented semantics.

However, I could not find a direct answer to my question in the docs. I
looked primarily at https://www.postgresql.org/docs/current/sql-grant.html
and https://www.postgresql.org/docs/current/sql-createtable.html . There
are references to permissions required to create references, but not to the
permissions (not, apparently) required to indirectly write to a table via
referential actions.

Am I correct that (a) no permissions are needed here and (b) this is
undocumented and (c) it would be helpful to document this, probably in the
CREATE TABLE docs? Happy to write a patch if so.

--dave

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Laurenz Albe 2020-02-25 09:54:52 Re: No docs for interaction of ON DELETE/UPDATE and permissions
Previous Message Tom Lane 2020-02-24 14:55:32 Re: Information regarding how to build libpq client using visual studio is missing