Sample Exam Questions

From the objective of OSS-DB Exam Silver
- Operation management - Installation method

Sample Question


Choose two incorrect statements about the template databases.

  1. You can not add an object to template0 with CREATE TABLE etc
  2. It is not possible to add an object to template1 with CREATE TABLE etc.

  3. template0 can not be deleted with DROP DATABASE
  4. template1 can not be deleted with DROP DATABASE

  5. You can create a new database using the database postgres as a template database

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

Answer and Explanation

In a database cluster just initialized by the initdb command, there are two template databases, template0 and template1, and a database  named postgres. template0 contains only system-standard objects. You can not add an object to template0, nor can you delete template0 itself.

In the initial state, template0 and template1 have the same contents, but you can add objects to template1 freely.

CREATE DATABASE in PostgreSQL is a copy of the template database.

By default, a copy of template1 is created, so if you have objects or functions you want to use commonly across multiple databases, you can make them available in any database by creating them in template1 beforehand.

You can also delete template1 with DROP DATABASE. Of course, when executing CREATE DATABASE without template1, you need to explicitly specify the appropriate template database.

You can specify a database other than template1 as the template database. Not each template has an attribute as to whether it is a template or not, you can also create a copy of the postgres database as a template.


Because it is a matter of choosing what is wrong, the correct answers are B and D.