PostgreSQL Associate Roles and Privileges Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Thames
T
Thames
Community Contributor
Quizzes Created: 11982 | Total Attempts: 187,298
| Questions: 20 | Updated: Aug 15, 2026
Please wait...
Question 1 / 21
🏆 Rank #-- ▾
0 %
0/100
Score 0/100

1. True or False: The PUBLIC schema privileges apply to all users automatically.

Explanation

PUBLIC is a special role that represents all database users. Any privileges granted to PUBLIC are available to every user automatically, so they do not need to be granted to each user individually.

Submit
Please wait...
About This Quiz
PostgreSQL Associate Roles and Privileges Quiz - Quiz

This quiz assesses your understanding of PostgreSQL roles, user management, and privilege systems. It covers role creation, permission assignment, role inheritance, and security best practices. Essential for anyone preparing for PostgreSQL Associate Certification or managing database access control.

2.

What first name or nickname would you like us to use?

You may optionally provide this to label your report, leaderboard, or certificate.

2. True or False: Role inheritance is automatically enabled for all roles.

Explanation

Role inheritance is not necessarily enabled by default for every role. It typically requires explicit configuration or a defined hierarchy, and behavior can vary by system. Without that setup, a role does not automatically receive another role’s permissions; its access is determined by permissions assigned directly to it.

Submit

3. Which privilege allows a role to delete rows from a table?

Explanation

The DELETE privilege permits a role to remove rows from a table. It affects the table’s data, not the table itself; removing an entire table requires a different privilege, such as DROP.

Submit

4. What does the BYPASSRLS attribute allow a role to bypass?

Explanation

The BYPASSRLS attribute lets a database role ignore row-level security policies when accessing tables. This can allow the role to view or modify rows that those policies would otherwise hide or restrict. It does not bypass column-level controls, schema permissions, or connection limits.

Submit

5. True or False: GRANT ALL PRIVILEGES grants every possible privilege on an object.

Explanation

`GRANT ALL PRIVILEGES` grants the recipient every privilege applicable to the specified object, such as permitted read, write, or execution rights. Its scope is limited to that object and to privileges the grantor is authorized to grant; it does not automatically confer ownership or privileges on unrelated objects.

Submit

6. Which privilege grants permission to insert rows into a table?

Explanation

The INSERT privilege allows a user to add new rows to a table. It grants permission to insert data without necessarily allowing the user to modify or delete existing rows.

Submit

7. What command changes a role's password?

Explanation

In PostgreSQL, `ALTER ROLE` modifies a role’s attributes, including its password. Specify the role name and use the `WITH PASSWORD` clause, such as `ALTER ROLE app_user WITH PASSWORD 'new_secret';`. The other listed phrases are not the standard command syntax for changing a role’s password.

Submit

8. True or False: A role can have a password even if LOGIN is not set.

Explanation

A PostgreSQL role can have a password stored even when it lacks the `LOGIN` attribute. The password alone does not allow the role to connect; `LOGIN` must also be enabled. This lets administrators configure credentials in advance or keep a role’s password while preventing direct logins.

Submit

9. Which view displays current role membership and attributes?

Submit

10. What does the CREATEROLE attribute allow a role to do?

Explanation

The CREATEROLE attribute gives a role permission to create additional database roles and manage eligible existing roles, such as changing their attributes or removing them, subject to PostgreSQL’s security restrictions. It does not by itself grant permission to create databases or schemas, nor does it provide unrestricted administrative or superuser access.

Submit

11. What command creates a new role in PostgreSQL?

Explanation

`CREATE ROLE` is the PostgreSQL command used to define a new role. Roles can represent users or groups and may be granted permissions to control access to database objects and operations.

Submit

12. Which privilege allows a role to execute a function?

Explanation

The EXECUTE privilege allows a role to run a function or stored procedure. It authorizes calling the routine without necessarily granting access to its underlying tables or other objects; those permissions are managed separately, depending on the database system. CALL, RUN, and INVOKE are not the standard privilege name for this permission.

Submit

13. What does the CREATEDB attribute allow a role to do?

Explanation

The CREATEDB attribute grants a role permission to create new databases in the PostgreSQL server. It does not, by itself, allow the role to delete databases, change database settings, or access every database.

Submit

14. True or False: Only superusers can create new roles in PostgreSQL.

Explanation

This statement is not generally true. PostgreSQL allows users with the `CREATEROLE` attribute to create roles without being superusers. Superuser privileges are required for certain elevated role operations, but not for creating every role. Under current PostgreSQL rules, the answer should be **False**.

Submit

15. Which command removes privileges from a role?

Explanation

`REVOKE` removes previously granted privileges from a role, limiting the actions it can perform. `DENY` explicitly blocks permissions in some systems, while `REMOVE PRIVILEGES` and `STRIP` are not standard SQL commands for withdrawing grants.

Submit

16. What does the SUPERUSER attribute grant to a role?

Explanation

The SUPERUSER attribute grants a role unrestricted access to the database system. It can perform any operation and bypasses normal permission checks, unlike roles with privileges limited to specific tasks or objects.

Submit

17. True or False: A role can inherit privileges from other roles.

Explanation

True. In systems that support role hierarchies, one role can be granted to another. The receiving role then inherits the privileges associated with the granted role, allowing administrators to manage access through role assignments rather than granting every privilege individually.

Submit

18. Which command grants privileges on a table to a role?

Explanation

`GRANT` is the SQL command used to give a user or role specific privileges, such as permission to read or modify a table. For example, `GRANT SELECT ON table_name TO role_name;` grants the role permission to query the table.

Submit

19. What is the primary difference between a role and a user in PostgreSQL?

Explanation

In PostgreSQL, “user” is essentially a role configured with the `LOGIN` attribute, allowing it to authenticate and connect to the database. Roles without `LOGIN` can still be used to group permissions or grant access, but they cannot connect directly as a user.

Submit

20. Which attribute allows a role to log in to the database?

Explanation

In PostgreSQL, the LOGIN attribute allows a role to authenticate and start a database session. Roles without LOGIN can still own objects or receive privileges, but cannot connect directly. This distinction lets administrators use non-login roles to group permissions and grant connection capability only to user roles as needed.

Submit
×
Saved
Thank you for your feedback!
View My Results
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
True or False: The PUBLIC schema privileges apply to all users...
True or False: Role inheritance is automatically enabled for all...
Which privilege allows a role to delete rows from a table?
What does the BYPASSRLS attribute allow a role to bypass?
True or False: GRANT ALL PRIVILEGES grants every possible privilege on...
Which privilege grants permission to insert rows into a table?
What command changes a role's password?
True or False: A role can have a password even if LOGIN is not set.
Which view displays current role membership and attributes?
What does the CREATEROLE attribute allow a role to do?
What command creates a new role in PostgreSQL?
Which privilege allows a role to execute a function?
What does the CREATEDB attribute allow a role to do?
True or False: Only superusers can create new roles in PostgreSQL.
Which command removes privileges from a role?
What does the SUPERUSER attribute grant to a role?
True or False: A role can inherit privileges from other roles.
Which command grants privileges on a table to a role?
What is the primary difference between a role and a user in...
Which attribute allows a role to log in to the database?
play-Mute sad happy unanswered_answer up-hover down-hover success oval cancel Check box square blue
Alert!