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