Re: getting permission denied error for user2 while proper privileges are present

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: rajan <vgmonnet(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: getting permission denied error for user2 while proper privileges are present
Date: 2019-05-18 15:07:05
Message-ID: 21064.1558192025@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

rajan <vgmonnet(at)gmail(dot)com> writes:
> Please notice the lines where GRANT and ALTER DEFAULT PRIVILEGES are
> executed. Even though I am executing those statements as postgres user, when
> viewing the privileges the grantor is always the learner user. How is that
> possible?

The GRANT page says

If a superuser chooses to issue a GRANT or REVOKE command, the command
is performed as though it were issued by the owner of the affected
object. In particular, privileges granted via such a command will
appear to have been granted by the object owner. (For role membership,
the membership appears to have been granted by the containing role
itself.)

Essentially, the superuser is making use of her privilege to become
the object's owning role.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message David W Noon 2019-05-18 15:33:13 Unsubscribing from list (was: Problem in
Previous Message rajan 2019-05-18 05:50:26 Re: getting permission denied error for user2 while proper privileges are present