Redshift Observatory

System Table Tracker

System view pg_catalog.svv_role_grants version 1.0.56242 / 2023-09-15

schema name column data type
pg_catalog svv_role_grants granted_role_id int4
pg_catalog svv_role_grants granted_role_name varchar(128)
pg_catalog svv_role_grants role_id int4
pg_catalog svv_role_grants role_name varchar(128)

View Text

SELECT derived_table1.role_id,
       derived_table1.role_name,
       derived_table1.granted_role_id,
       derived_table1.granted_role_name
FROM (SELECT chain.childroleid AS role_id,
             CAST(role.rolname AS varchar(128)) AS role_name,
             chain.parentroleid AS granted_role_id,
             CAST(granted_role.rolname AS varchar(128)) AS granted_role_name
      FROM pg_role_chain AS chain
           INNER JOIN (SELECT pg_role.rolid,
                              pg_role.rolname
                       FROM pg_role
                       WHERE EXISTS (SELECT 1
                                     FROM pg_identity
                                     WHERE pg_identity.useid = current_user_id()
                                       AND pg_identity.usesuper = TRUE)
                          OR has_system_privilege(CAST("current_user"() AS name),
                                                  CAST('ACCESS SYSTEM TABLE' AS text))
                          OR user_is_member_of_role(CAST("current_user"() AS name),
                                                    pg_role.rolname)
                          OR current_user_id() = pg_role.rolowner) AS role ON chain.childroleid = role.rolid
           INNER JOIN (SELECT pg_role.rolid,
                              pg_role.rolname
                       FROM pg_role
                       WHERE EXISTS (SELECT 1
                                     FROM pg_identity
                                     WHERE pg_identity.useid = current_user_id()
                                       AND pg_identity.usesuper = TRUE)
                          OR has_system_privilege(CAST("current_user"() AS name),
                                                  CAST('ACCESS SYSTEM TABLE' AS text))
                          OR user_is_member_of_role(CAST("current_user"() AS name),
                                                    pg_role.rolname)
                          OR current_user_id() = pg_role.rolowner) AS granted_role ON chain.parentroleid = granted_role.rolid) AS derived_table1


Home 3D Друк Blog Bring-Up Times Consultancy Cross-Region Benchmarks Email Forums IRC Mailing Lists Reddit Redshift Price Tracker Redshift Version Tracker Redshift Workbench System Table Tracker The Known Universe Twitter White Papers