BUG #17626: Permission denied errors should list role as well as user

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: loren(at)paradigm(dot)xyz
Subject: BUG #17626: Permission denied errors should list role as well as user
Date: 2022-10-01 21:09:54
Message-ID: 17626-644f053cc20e1ba3@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 17626
Logged by: Loren Siebert
Email address: loren(at)paradigm(dot)xyz
PostgreSQL version: 14.5
Operating system: Debian
Description:

I'm running this set of commands:
create user elevated_user IN ROLE pg_read_all_data;
create user regular_user;
create table foo (id int);
set role elevated_user;
select * from foo; -- works
set role regular_user;
select * from foo; -- errors

The error message looks like "user=elevated_user ERROR: permission denied
for table foo".
In fact, that user does have permission to access the table. But the
regular_role it has just assumed does not.
I would suggest that the error message look like "user=elevated_user,
role=regular_user ERROR: permission denied for table foo"

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Shane Plesner 2022-10-01 21:44:31 Re: Bug / Unintentional Feature: non-immutable functions can be used for generated columns.
Previous Message David G. Johnston 2022-10-01 18:54:36 Re: Bug / Unintentional Feature: non-immutable functions can be used for generated columns.