Re: set role issue

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fabrice Chapuis <fabrice636861(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: set role issue
Date: 2025-08-04 14:30:19
Message-ID: 856556.1754317819@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fabrice Chapuis <fabrice636861(at)gmail(dot)com> writes:
> I do the following command when connecting locally with user postgres
> SET ROLE asuperrole; -- asuperrole has superuser privilege
> GRANT SELECT ON pg_statistic TO test_role;

> why the grantee is postgres?

You mean "grantor", no? When a superuser does grant/revoke on some
object, it's recorded as though the object owner issued the command.
And postgres is the owner of the pg_statistic table.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2025-08-04 14:53:18 Re: [PATCH] OAuth: fix performance bug with stuck multiplexer events
Previous Message jian he 2025-08-04 14:29:22 Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions