information_schema.applicable_roles behavior does not match documentation

Started by PG Bug reporting formabout 8 years ago1 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/10/static/infoschema-applicable-roles.html
Description:

The documentation for applicable_roles says: "The current user itself is
also an applicable role." (see
https://www.postgresql.org/docs/current/static/infoschema-applicable-roles.html)

My understanding is that the current user should be listed in
information_schema.applicable_roles, but a quick check shows that it is
not.

marc=> select * from information_schema.applicable_roles;
grantee | role_name | is_grantable
---------+-----------+--------------
marc | foo | YES
(1 row)

It properly shows the role I am a member of, but not myself.

By contrast, the docs for enabled_roles also say that it includes the
current user, and it actually does:

marc=> select * from information_schema.enabled_roles;
role_name
-----------
foo
marc
(2 rows)

This also isn't a user vs role issue. If I "set role foo", it is no longer
visible in applicable_roles.