Sample Exam Questions

From the objective of OSS-DB Exam Silver
- Operation and Management - How to use standard attached tool (How to use database management command)

Sample Question


Choose two correct statements regarding the creation of new users utilizing the createuser command.

  1. The createuser command must be run with the same user account as the user running the database server process.
  2. The createuser command must be executed with a user account on the same server on which the server process of the database is running.
  3. The createuser command must be run with a user account that has a CREATEROLE privilege on the database.
  4. The user name to be newly created must be the same as the user account name existing on the OS.
  5. The newly created user name can be determined regardless of the user account name on the OS.

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

Answer and Explanation

The createuser command is an OS command that can connect to a PostgreSQL instance from the OS command line and create a new database user.
The connection destination database cluster is specified by a combination of the command line option - h (or - host) and - p (or - port), and the user name when connecting is specified by - U (or - user name). When these are omitted, default values determined by environment variables etc. are used.
You can run createuser even if it is not necessarily on the same server, as long as the connection destination database is running on the host specified with the -h option. Also, as long as the database user to be connected has superuser or CREATEROLE privilege, it is not necessary to run as the same user as the server process.
The method of user authentication when connecting to a database varies depending on the environment, but if you can not connect with a user with CREATEROLE privilege, you can not execute the createuser command.
The user name of the database user to be created can be used regardless of the OS user name.

Therefore, the correct answers are C and E.