0
0
PostgreSQLquery~5 mins

Login vs group roles in PostgreSQL - Quick Revision & Key Differences

Choose your learning style9 modes available
Recall & Review
beginner
What is a login role in PostgreSQL?
A login role is a user account that can connect to the database. It has permission to log in and perform actions based on its privileges.
Click to reveal answer
beginner
What is a group role in PostgreSQL?
A group role is a collection of roles. It cannot log in but can own privileges that are shared with its member roles.
Click to reveal answer
beginner
Can a group role log in to the database?
No, group roles cannot log in. Only login roles have the ability to connect to the database.
Click to reveal answer
intermediate
How do group roles help manage permissions?
Group roles let you assign permissions once to the group. Then all member roles inherit those permissions, making management easier.
Click to reveal answer
intermediate
How do you add a login role to a group role in PostgreSQL?
Use the SQL command: GRANT group_role TO login_role; This makes the login role a member of the group role.
Click to reveal answer
Which PostgreSQL role type can connect to the database?
AGroup role
BLogin role
CBoth login and group roles
DNeither
What is the main purpose of a group role?
ATo own and share permissions among member roles
BTo store data
CTo log in to the database
DTo create tables
How do you make a login role a member of a group role?
ACREATE ROLE login_role IN group_role;
BADD login_role TO group_role;
CALTER ROLE login_role SET group_role;
DGRANT group_role TO login_role;
Can a group role own database objects like tables?
AOnly superusers can own objects
BNo, only login roles can own objects
CYes, group roles can own objects
DGroup roles can own objects only if they can log in
If a login role is a member of multiple group roles, what permissions does it have?
APermissions from all group roles it belongs to
BOnly permissions assigned directly to the login role
CNo permissions from group roles
DOnly permissions from the first group role
Explain the difference between a login role and a group role in PostgreSQL.
Think about who can log in and how permissions are shared.
You got /4 concepts.
    Describe how group roles simplify permission management in PostgreSQL.
    Consider how managing permissions individually compares to using groups.
    You got /4 concepts.