Sample Exam Questions

From the objective of OSS-DB Exam Silver
- Operation management - How to use standard attached tool

Sample Question

1.36

Choose two appropriate descriptions for executing PostgreSQL user and role creation from the OS command line.

  1. Use createuser to create users and createrole commands to create roles.port.
  2. To execute the createuser command, you need the CREATEUSER privilege.
  3. Executing with the -d option grants database creation authority to new users.
  4. When executed with the -u option, new user is granted user creation authority.
  5. When executed with the -s option, the superuser privilege is granted to the new user.

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

Answer and Explanation

To create a database user, execute the createuser command from the OS command line, or connect to the database with psql and execute the CREATE USER statement. In the PostgreSQL implementation there is no distinction between users and roles, so you can create roles with these commands. In SQL, you can use the CREATE ROLE statement, but there is no command called createrole.

To execute the createuser command you need CREATEROLE privilege. There is also the authority CREATEUSER (deprecated), but since it is the same privilege as the superuser, it is not required to run the createuser command.

You can give privileges to new users by executing createuser with options. The -d option grants database creation authority, the -r option authorizes user (role) creation, and -s superuser privilege. To grant superuser privileges, the user who executes createuser itself must have superuser privileges.

Therefore, the correct answers are C and E.