PostgreSQL Associate Backup and Restore Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Thames
T
Thames
Community Contributor
Quizzes Created: 11982 | Total Attempts: 187,298
| Attempts: 12 | Questions: 20 | Updated: Aug 15, 2026
Please wait...
Question 1 / 21
🏆 Rank #-- ▾
0 %
0/100
Score 0/100

1. What does wal_level = replica enable in PostgreSQL?

Explanation

`wal_level = replica` records enough information in the WAL to support standby-server replication and point-in-time recovery (PITR). WAL archiving still requires separate configuration, such as `archive_mode` and an archive command. This setting does not compress backup files.

Submit
Please wait...
About This Quiz
PostgreSQL Associate Backup and Restore Quiz - Quiz

This quiz evaluates your understanding of PostgreSQL backup and restore operations, covering essential techniques for data protection and recovery. It tests knowledge of backup methods, restoration procedures, point-in-time recovery, and best practices for maintaining database integrity. Master these concepts to ensure reliable data management and disaster recovery in production PostgreSQL... see moreenvironments. see less

2.

What first name or nickname would you like us to use?

You may optionally provide this to label your report, leaderboard, or certificate.

2. Streaming replication can be used as a backup method for continuous data protection.

Explanation

Streaming replication continuously transfers database changes from a primary system to a standby, keeping the standby nearly up to date. This can support continuous data protection by enabling recovery after a primary-system failure. However, because unwanted changes may also replicate, it should be complemented by separate backups for protection against deletion, corruption, or other logical errors.

Submit

3. What is the primary difference between a logical backup and a physical backup?

Explanation

A logical backup stores database contents as logical structures and data—such as tables and SQL statements or exported records—so it can often be restored across different environments. A physical backup copies the underlying database files or disk blocks, preserving their on-disk representation and typically requiring compatible database software and configuration.

Submit

4. Recovery_target_xid allows recovery to a specific transaction ID during PITR.

Explanation

In PostgreSQL, `recovery_target_xid` identifies the transaction ID at which point-in-time recovery should stop. This lets an administrator restore the database to a state associated with a particular transaction, rather than only to a timestamp or named restore point. The `recovery_target_inclusive` setting controls whether that transaction itself is included.

Submit

5. Which backup format created by pg_dump can be restored selectively with pg_restore?

Explanation

Custom (-F c) and TAR (-F t) dumps use archive formats that pg_restore can inspect and restore selectively, including chosen database objects. Plain text (-F p) produces SQL statements intended to be executed with a client such as psql, rather than processed by pg_restore.

Submit

6. The restore_command is executed during PITR to retrieve archived WAL files.

Explanation

During point-in-time recovery, PostgreSQL replays archived write-ahead log (WAL) segments to restore the database to the desired state. The configured `restore_command` retrieves each required WAL file from the archive so recovery can continue.

Submit

7. What is the advantage of using pg_basebackup over pg_dump for large databases?

Explanation

`pg_basebackup` creates a physical copy of the database files, avoiding the time required to export and reload large amounts of SQL data. In supported PostgreSQL versions, it can also create incremental backups, which copy only changes since a previous backup and support more efficient recovery workflows.

Submit

8. Pg_dumpall backs up all databases and global objects like roles and tablespaces.

Explanation

`pg_dumpall` creates a logical backup of every database in a PostgreSQL cluster and includes cluster-wide objects, such as roles and tablespaces. This differs from `pg_dump`, which backs up a single database. The statement is therefore true.

Submit

9. Which file contains PostgreSQL configuration settings for recovery?

Explanation

In PostgreSQL versions before 12, `recovery.conf` contained settings used during recovery, such as instructions for restoring archived WAL files or promoting a standby server. PostgreSQL 12 and later no longer use this file; recovery settings are configured differently, often through `postgresql.conf` and signal files such as `standby.signal`.

Submit

10. The recovery_target_timeline parameter specifies which timeline to recover to during PITR.

Explanation

During point-in-time recovery, `recovery_target_timeline` selects the timeline PostgreSQL should follow when replaying archived WAL. It can specify a particular timeline or use `latest` to follow the newest available timeline.

Submit

11. Which PostgreSQL utility creates a logical backup of a database in SQL format?

Explanation

`pg_dump` creates a logical backup by exporting a database’s schema and data. It can produce SQL statements that can later be run to recreate the database contents. `pg_basebackup`, by contrast, creates a physical backup, while `pg_restore` restores supported backup files rather than creating a backup.

Submit

12. PITR allows recovery to any point in time as long as WAL files are available.

Explanation

Point-in-time recovery (PITR) replays archived write-ahead log (WAL) records on top of a base backup, allowing a database to be restored to a chosen moment. Recovery requires the necessary WAL sequence and a suitable base backup; missing WAL files can prevent reaching the desired point.

Submit

13. Which command restores a backup created by pg_dump in custom format?

Explanation

`pg_dump` custom-format backups are stored as archive files rather than plain SQL scripts. `pg_restore` reads this archive and restores its database objects and data, with options to control what is restored. `psql` is typically used to execute plain-text SQL dumps, while `pg_basebackup` creates physical backups.

Submit

14. What does the -F c option do when used with pg_dump?

Explanation

The `-F c` option tells `pg_dump` to create a backup in PostgreSQL’s custom archive format. This format supports compression and allows selective restoration of database objects with `pg_restore`.

Submit

15. Pg_dump produces a backup format that is portable across different PostgreSQL versions.

Explanation

pg_dump creates a logical backup containing SQL commands and data, rather than a version-specific copy of PostgreSQL’s internal files. This generally makes it portable between PostgreSQL versions, though restoring to an older version may require adjustments and is not guaranteed in every case.

Submit

16. Which parameter controls where PostgreSQL archives WAL files?

Explanation

`archive_command` defines the command PostgreSQL runs to archive each completed WAL segment, typically copying it to a designated directory or storage system. It can use placeholders such as `%p` for the WAL file’s path and `%f` for its filename. `restore_command` is used to retrieve archived WAL files during recovery.

Submit

17. What is the primary purpose of the pg_basebackup utility?

Explanation

`pg_basebackup` creates a physical copy of a PostgreSQL database cluster, including its data files and required WAL information. This backup can be used to restore the cluster or set up a standby server; it is not designed to restore individual tables, compress backups, or encrypt them.

Submit

18. Point-in-time recovery (PITR) requires archiving which type of data?

Explanation

Point-in-time recovery uses archived transaction logs, commonly called write-ahead log (WAL) files, to replay database changes after a base backup. Replaying those logs lets the database be restored to a specific moment. Logical backups, schema files, or index definitions alone do not capture the sequence of changes needed for this recovery.

Submit

19. Which backup method captures the physical file structure of a running PostgreSQL cluster?

Explanation

pg_basebackup creates a physical backup by copying the PostgreSQL cluster’s data files while the server is running, using the replication protocol to ensure consistency. In contrast, pg_dump and pg_dumpall produce logical backups, while COPY exports table data rather than the cluster’s physical file structure.

Submit

20. What does WAL stand for in PostgreSQL?

Explanation

WAL stands for Write-Ahead Logging. PostgreSQL records changes in a log before applying them to database files, helping ensure data consistency and support recovery after a crash.

Submit
×
Saved
Thank you for your feedback!
View My Results
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
What does wal_level = replica enable in PostgreSQL?
Streaming replication can be used as a backup method for continuous...
What is the primary difference between a logical backup and a physical...
Recovery_target_xid allows recovery to a specific transaction ID...
Which backup format created by pg_dump can be restored selectively...
The restore_command is executed during PITR to retrieve archived WAL...
What is the advantage of using pg_basebackup over pg_dump for large...
Pg_dumpall backs up all databases and global objects like roles and...
Which file contains PostgreSQL configuration settings for recovery?
The recovery_target_timeline parameter specifies which timeline to...
Which PostgreSQL utility creates a logical backup of a database in SQL...
PITR allows recovery to any point in time as long as WAL files are...
Which command restores a backup created by pg_dump in custom format?
What does the -F c option do when used with pg_dump?
Pg_dump produces a backup format that is portable across different...
Which parameter controls where PostgreSQL archives WAL files?
What is the primary purpose of the pg_basebackup utility?
Point-in-time recovery (PITR) requires archiving which type of data?
Which backup method captures the physical file structure of a running...
What does WAL stand for in PostgreSQL?
play-Mute sad happy unanswered_answer up-hover down-hover success oval cancel Check box square blue
Alert!