Re: getting permission denied error for user2 while proper privileges are present - Mailing list pgsql-sql

From Tom Lane
Subject Re: getting permission denied error for user2 while proper privileges are present
Date
Msg-id 21064.1558192025@sss.pgh.pa.us
Whole thread Raw
In response to Re: getting permission denied error for user2 while properprivileges are present  (rajan <vgmonnet@gmail.com>)
Responses Re: getting permission denied error for user2 while properprivileges are present  (rajan <vgmonnet@gmail.com>)
List pgsql-sql
rajan <vgmonnet@gmail.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



pgsql-sql by date:

Previous
From: rajan
Date:
Subject: Re: getting permission denied error for user2 while properprivileges are present
Next
From: David W Noon
Date:
Subject: Unsubscribing from list (was: Problem in