Sample Exam Questions

From the objective of OSS-DB Exam Silver
S2.5 Basic server administration (Adding, deleting and modifying database role / user)

Sample Question


Choose three things you can do with ALTER USER or ALTER ROLE:

  1. Create a new database user.

  2. Change the password of a database user.

  3. To grant user creation permission to a database user.

  4. Change the database user to an administrator user.

  5. Grant database users access to specific tables.

※This sample exam is different from those that appear in the actual OSS-DB Exam.

Answer and Explanation

In the PostgreSQL implementation, users and roles are exactly the same: CREATE USER and ALTER USER internally execute CREATE ROLE and ALTER ROLE. What they can do is exactly the same.

CREATE USER/ROLE allows you to create a new user role and specify attributes such as privileges. ALTER USER/ROLE does not allow you to create new user roles, but it does allow you to change the attributes that can be specified in CREATE for existing user roles. Attributes that can be specified or modified by CREATE or ALTER include password, whether or not the user has permission to create users, whether or not the user has permission to create databases, and whether or not the user is a superuser (administrator user).

Access to individual objects, such as tables, is granted with GRANT, not ALTER USER/ROLE.

So the correct answers are B, C and D.