Sample Exam Questions

From the objective of OSS-DB Exam Silver
S2.4 Backup and restore (Usage of various backup commands)

Sample Question


Choose one incorrect description of the function and purpose of the PostgreSQL commands.

  1. The pg_dump command can create a database backup in text format.

  2. The pg_dumpall command can create a binary backup of an entire database cluster.

  3. The pg_basebackup command can create a base backup for point-in-time recovery (PITR).

  4. The psql command can restore from a text backup.

  5. The pg_restore command can restore from a binary backup.

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

Answer and Explanation

pg_dump is a command that creates a backup of one database in a database cluster. The format of the output file is specified by the -F option, but it can be either in text or binary format.
pg_dumpall is a command that creates a backup of an entire database cluster and can output global objects (such as user information) that pg_dump cannot retrieve. The output file is in text format only.
The backup files in text format output by pg_dump and pg_dumpall can be viewed in a text editor, etc. They are the scripts containing SQL statements to create database objects, such as CREATE TABLE, which can be used for restoring with the psql command.
Binary backup files created by pg_dump can be used to restore with a special command called pg_restore.
pg_basebackup is a command that creates a physical backup of a database cluster, which can be used as a starting point for PITR or streaming replication.

This is a question where you need to select the incorrect option, so the correct answer is B.