From: Tom Lane <tgl@sss.pgh.pa.us>
To: pg.org@realityexists.net
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16911: "permission denied" error deleting rows as superuser from a table owned by a non-superuser
Date: Wed, 03 Mar 2021 14:04:53 -0500
Message-ID: <1205670.1614798293@sss.pgh.pa.us> (raw)
In-Reply-To: <16911-ca792f6bbe244754@postgresql.org>
References: <16911-ca792f6bbe244754@postgresql.org>
PG Bug reporting form <noreply@postgresql.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.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, pg.org@realityexists.net, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16911: "permission denied" error deleting rows as superuser from a table owned by a non-superuser
In-Reply-To: <1205670.1614798293@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox