PostgreSQL Professional Streaming Replication 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: 11 | Questions: 20 | Updated: Aug 15, 2026
Please wait...
Question 1 / 21
🏆 Rank #-- ▾
0 %
0/100
Score 0/100

1. In the recovery.conf file, what does the standby_mode parameter indicate?

Explanation

The `standby_mode` parameter tells the server to start in standby mode, where it retrieves and continuously applies WAL (Write-Ahead Log) records to stay synchronized with the primary server.

Submit
Please wait...
About This Quiz
PostgreSQL Professional Streaming Replication Quiz - Quiz

This quiz evaluates your understanding of PostgreSQL streaming replication, a critical feature for high-availability database systems. You'll test your knowledge of replication setup, WAL archiving, standby server configuration, and failover mechanisms. Ideal for database administrators and engineers preparing for PostgreSQL certification or implementing production replication solutions.

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. What command is used to manually promote a standby server to primary?

Explanation

`pg_ctl promote` is a PostgreSQL command that manually promotes a standby server to primary, ending its recovery process so it can accept read-write connections.

Submit

3. In streaming replication, what does the wal_receiver_timeout parameter do?

Explanation

`wal_receiver_timeout` sets the maximum time the standby waits for activity from the primary before treating the connection as lost. If no data arrives within that interval, the WAL receiver detects a possible disconnection and can respond accordingly.

Submit

4. What is the primary advantage of using logical replication over streaming replication?

Explanation

Logical replication operates at the table level, allowing you to choose which tables to replicate and filter specific rows or changes. This provides more flexibility than streaming replication, which typically copies the entire database cluster’s WAL changes.

Submit

5. Which view displays information about all replication slots and their status?

Explanation

In PostgreSQL, `pg_replication_slots` lists all replication slots on the server and shows details such as each slot’s type, status, and the WAL position it requires. This helps administrators monitor slot usage and identify slots that may retain WAL files. Other options report connected replicas, calculate WAL-position differences, or track replication origins.

Submit

6. What does promote_trigger_file accomplish on a standby server?

Explanation

When `promote_trigger_file` is configured, creating the specified file on the standby signals it to leave recovery mode and promote itself to the primary server. This provides a simple, file-based way to trigger failover.

Submit

7. Which parameter controls whether a standby server blocks during WAL apply?

Explanation

`max_standby_streaming_delay` sets how long a standby may delay applying streamed WAL when replay conflicts with a running query, such as one needing rows that WAL would remove. Once the limit is reached, PostgreSQL cancels conflicting queries so recovery can proceed. The other options control connection timeouts, commit behavior, or intentional replay delay.

Submit

8. In cascading replication, what role does an intermediate server play?

Explanation

In cascading replication, an intermediate server receives and replays changes from an upstream primary or standby, then streams those changes to downstream standby servers. This creates a relay chain that reduces the primary’s direct replication load. The intermediate server acts as a replica upstream and a replication source downstream.

Submit

9. What is the purpose of pg_wal_lsn_diff() function?

Explanation

`pg_wal_lsn_diff()` computes the distance, in bytes, between two PostgreSQL WAL log sequence numbers (LSNs). It is useful for measuring how much WAL has been generated or how far apart two WAL positions are.

Submit

10. Which parameter specifies the command to retrieve WAL files for streaming replication?

Explanation

In PostgreSQL, `restore_command` defines how a standby or recovering server retrieves a requested WAL segment from the archive. It is invoked when the needed segment is not already available locally, typically using placeholders for the WAL filename and destination path. `primary_conninfo` configures streaming connection details, `archive_command` writes WAL files to an archive, and `wal_retrieve_retry_interval` controls retry timing.

Submit

11. What is the primary purpose of WAL (Write-Ahead Logging) in PostgreSQL streaming replication?

Explanation

WAL records database changes before they are written to the main data files. This lets PostgreSQL recover committed transactions after a crash and provides the log records that streaming replication sends from the primary server to standby servers.

Submit

12. What does the wal_keep_size parameter specify?

Explanation

`wal_keep_size` specifies the minimum amount of write-ahead log (WAL) data PostgreSQL retains so standby servers can retrieve it for replication. If a standby falls behind beyond the retained WAL, it may need to be resynchronized.

Submit

13. Which tool is used to create a physical backup of the primary database for standby setup?

Explanation

`pg_basebackup` creates a physical copy of a PostgreSQL database cluster, including the data files needed to initialize a standby server. It can also collect the required write-ahead log data, supporting recovery and replication. By contrast, `pg_dump` creates a logical backup, while `pg_restore` restores one and `pg_repack` reorganizes tables.

Submit

14. What parameter on the standby server enables it to accept read queries?

Explanation

Setting `hot_standby = on` allows a PostgreSQL standby server to accept read-only queries while it replays WAL records from the primary. This lets applications run reports or other reads against the standby without interrupting recovery. The other settings concern standby operation, recovery timeline selection, or WAL receiver status reporting rather than enabling query access.

Submit

15. Which command creates a physical replication slot on the primary server?

Explanation

Run `pg_create_physical_replication_slot('slot_name')` on the primary to create a physical replication slot with that name. The function returns the slot’s details and helps retain required WAL files for a standby. The other options do not create a physical slot using this SQL function.

Submit

16. What is a replication slot's primary function?

Explanation

A replication slot tracks a replica’s progress and retains the WAL segments it still needs. This prevents those segments from being recycled before the replica can receive or replay them, helping avoid replication gaps.

Submit

17. Which view shows the current replication status and lag on the primary server?

Explanation

On a PostgreSQL primary server, `pg_stat_replication` displays information about connected standby servers, including their connection state, write/flush/replay positions, and replication lag. These fields help administrators monitor whether replicas are receiving and applying changes promptly. Other listed options provide related information but do not offer this same overview of active replication connections.

Submit

18. In synchronous replication, what does synchronous_commit = remote_apply ensure?

Explanation

With `synchronous_commit = remote_apply`, a transaction is acknowledged only after the synchronous standby has received and applied its changes. This ensures the changes are visible on the standby before the commit completes, though it may increase transaction latency.

Submit

19. What does the max_wal_senders parameter control?

Explanation

In PostgreSQL, `max_wal_senders` sets the maximum number of WAL sender processes that can run at the same time. These processes send write-ahead log data to standby servers or other replication clients. It does not determine WAL file size, standby location, or the time allowed for archiving.

Submit

20. Which parameter enables streaming replication on the primary PostgreSQL server?

Explanation

Setting `wal_level` to `replica` makes PostgreSQL generate the additional write-ahead log information required for physical streaming replication. `max_wal_senders` controls concurrent sender processes, `synchronous_commit` affects commit acknowledgment behavior, and `hot_standby` applies to standby servers. Without an appropriate WAL level, the primary cannot stream the necessary replication data.

Submit
×
Saved
Thank you for your feedback!
View My Results
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
In the recovery.conf file, what does the standby_mode parameter...
What command is used to manually promote a standby server to primary?
In streaming replication, what does the wal_receiver_timeout parameter...
What is the primary advantage of using logical replication over...
Which view displays information about all replication slots and their...
What does promote_trigger_file accomplish on a standby server?
Which parameter controls whether a standby server blocks during WAL...
In cascading replication, what role does an intermediate server play?
What is the purpose of pg_wal_lsn_diff() function?
Which parameter specifies the command to retrieve WAL files for...
What is the primary purpose of WAL (Write-Ahead Logging) in PostgreSQL...
What does the wal_keep_size parameter specify?
Which tool is used to create a physical backup of the primary database...
What parameter on the standby server enables it to accept read...
Which command creates a physical replication slot on the primary...
What is a replication slot's primary function?
Which view shows the current replication status and lag on the primary...
In synchronous replication, what does synchronous_commit =...
What does the max_wal_senders parameter control?
Which parameter enables streaming replication on the primary...
play-Mute sad happy unanswered_answer up-hover down-hover success oval cancel Check box square blue
Alert!