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