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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: loren(at)paradigm(dot)xyz
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17626: Permission denied errors should list role as well as user
Date: 2022-10-03 13:50:55
Message-ID: 1425128.1664805055@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> 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".

No ... it just looks like

regression=> select * from foo; -- errors
ERROR: permission denied for table foo

I don't know where "user=elevated_user" is coming from in your
environment, but it seems like it must be from client-side code
that's not tracking the active role correctly.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2022-10-03 15:40:05 Re: BUG #17626: Permission denied errors should list role as well as user
Previous Message Guillaume Lelarge 2022-10-03 08:53:14 Re: Translation bug in French starting in v13