PostgreSQL Role Table Grants – Differences Between Users

postgresql

I have two users [UserA, UserB] — UserA is an existing user. I just created UserB and gave it GRANT ALL PRIVILEGES.

But when I try to see privileges by doing

select * from information_schema.role_table_grants

UserA sees a lot more rows than UserB in the public schema.

For example

  1. UserA can see all the rows with grantee in "admin_group", but UserB can't.
  2. UserA and UserB can see all the rows with grantee in "user_group".

This is confusing because I did not do anything special to "user_group" (that I know of). What additional permission do I have to give to UserB so it can see all rows in information_schema.role_table_grants.

Best Answer

One possible cause is that UserA belongs to "admin_group" and that UserB does not belong to "admin_group". Please post output of following statements run by a superuser from psql CLI:

\du userA
\du userB
select * from information_schema.role_table_grants where grantee='user_group';
select * from information_schema.role_table_grants where grantee='admin_group';