Re: BUG #16911: "permission denied" error deleting rows as superuser from a table owned by a non-superuser

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: "pg(dot)org(at)realityexists(dot)net" <pg(dot)org(at)realityexists(dot)net>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #16911: "permission denied" error deleting rows as superuser from a table owned by a non-superuser
Date: 2021-03-03 19:11:47
Message-ID: CAKFQuwasO=j1YoxRVh-Jn-XJo0J8A+OCyX_QzkFXOtLx76YUSw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wednesday, March 3, 2021, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> > CREATE TABLE myschema.fktable (customer_id int REFERENCES
> > myschema.pktable(id));
> > INSERT INTO myschema.pktable VALUES (1);
> > DELETE FROM myschema.pktable;
>
> > Expected result: no errors; the row is successfully deleted from
> > myschema.pktable.
> > Actual result: the final DELETE fails with
> > ERROR: permission denied for schema myschema
>
> This is operating as designed: the foreign key enforcement triggers
> run as the table owner, not as the calling user. Changing that would
> not be a good idea.
>
>
I could have sworn this was documented but I couldn’t find it.

David J.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Evgeny Morozov 2021-03-03 21:36:01 Re: BUG #16911: "permission denied" error deleting rows as superuser from a table owned by a non-superuser
Previous Message Tom Lane 2021-03-03 19:04:53 Re: BUG #16911: "permission denied" error deleting rows as superuser from a table owned by a non-superuser