Exam Information
Free practice questions with explanations
EnterpriseDB PostgreSQL-Essentials Practice Questions
Answer a question to see the correct answer and the explanation, or click Show answer. Newest questions first.
- Questions
- 17
- Answered
- 0
- Correct
- 0
- Score
- -
-
1 Question 1 Single choice Backup and Recovery Strategies
A company runs a PostgreSQL 13 primary on a 4 TB cluster. Their policy requires point-in-time recovery to any second within the last 14 days. The team currently runs a nightly pg_dump and archives nothing else. Storage budget is tight, and restores must be done on the same major version. Which approach best meets the requirement with the least additional storage overhead?
Correct Answer: AExplanationPoint-in-time recovery needs a physical base backup combined with a continuous WAL archive, so replaying archived WAL up to a target time is possible. A base backup taken with pg_basebackup plus archive_command shipping WAL segments gives exactly that. Hourly pg_dump files cannot restore to an arbitrary second and multiply storage use. Setting wal_level to minimal removes the WAL needed for archive-based recovery, and synchronous_commit only affects durability of commits, not the ability to recover to a past point in time.
-
2 Question 2 Single choice Configuration Parameters
A PostgreSQL 13 server with 64 GB of RAM hosts an analytics workload that performs large sorts and hash joins. Queries frequently spill to temporary files, as shown by log entries from log_temp_files. The DBA wants to reduce temp file usage for sessions without raising memory for every connection on the instance, since 400 clients connect concurrently. Which change is most appropriate?
Correct Answer: CExplanationwork_mem governs memory for each sort and hash operation within a query, and it can be set per role with ALTER ROLE. Because 400 connections share the server, a global increase multiplies memory use across every concurrent operation and risks swapping. Raising it only for the analytics role targets the workload without impacting others. shared_buffers caches data pages and does not hold sort workspace, and temp_buffers only applies to temporary tables, so neither fixes sort spills.
-
3 Question 3 Single choice Creating and Managing Databases
A developer is creating a new database for a multi-tenant application in PostgreSQL 13. Each tenant's data must be isolated so that a session connected to one tenant's database cannot query another tenant's tables. The team also wants all tenant databases to share a common default character set and locale, and to start from a standard template containing extensions. Which statement best meets these requirements?
Correct Answer: AExplanationSeparate databases provide the strongest isolation, since cross-database queries are not permitted in PostgreSQL and each database has its own catalogs. CREATE DATABASE with TEMPLATE set to a prepared database copies that template's objects, including installed extensions, and inherits its encoding and locale. Schemas share one database and rely on privileges for separation, which is weaker isolation. template0 does not carry the extensions, so manual installation adds work the requirement avoids. Tablespaces control physical storage location, not logical isolation.
-
4 Question 4 Single choice Database Clusters
A company operates a PostgreSQL 13 primary with one streaming replica for reporting. During a failover test, the replica was promoted with pg_ctl promote. The old primary was then restarted as-is and began accepting writes again, producing two diverging timelines. The operations lead wants to rejoin the old primary as a standby without rebuilding it from scratch if possible. Which action is most appropriate?
Correct Answer: AExplanationWhen an old primary has diverged after promotion, pg_rewind can rewind its data directory to the point where the timelines split, using WAL information, so it can follow the new primary without a full base backup. The server is then configured as a standby with standby.signal and primary_conninfo. Streaming replication cannot reconcile diverged histories on its own, deleting pg_wal destroys recovery information, and recovery_target_timeline controls recovery targeting rather than rejoining a diverged server.
-
5 Question 5 Single choice Database Maintenance
A PostgreSQL 13 table holding 300 million rows has grown heavily after a bulk delete removed 60 percent of its data. Query plans now show poor row estimates, and the table occupies far more disk space than its live data. The DBA must reclaim disk space and refresh planner statistics, but the table must remain readable by the application during the work, and the maintenance window is short. Which action is most appropriate?
Correct Answer: AExplanationPlain VACUUM ANALYZE makes dead tuple space reusable within the table and refreshes planner statistics while allowing concurrent reads and writes. It does not return space to the operating system, which is the trade-off to accept given the constraints. VACUUM FULL rewrites the table under an exclusive lock, blocking the application for the length of a large rewrite. REINDEX does not refresh table statistics or reclaim table heap space, and disabling autovacuum leaves bloat and stale statistics unaddressed.
-
6 Question 6 Single choice Database Objects and Hierarchy
A reporting team in PostgreSQL 13 queries a view that joins a customers table with an orders table. The view is used in dashboards that filter by customer region. Users report that queries are slow because the planner does not seem to push the region filter into the view's underlying scan. The view definition uses a subquery that computes an aggregate over orders. The team wants to keep one definition that dashboards can query directly. Which change is most likely to improve performance while preserving the interface?
Correct Answer: CExplanationExpressing the per-customer aggregation with a LATERAL subquery lets the planner correlate it to the outer row, so filters on region can be applied early and the work is limited to relevant customers. A view cannot have indexes, so the unique index option is invalid. A materialized view requires refreshing and does not keep the view's live interface, and a SETOF function is opaque to the planner and does not enable pushdown in the same way.
-
7 Question 7 Single choice Database Security
A healthcare startup stores patient records in PostgreSQL 13. Regulations require that the application service account can read and write only its own rows, that database administrators cannot see patient content through ordinary queries, and that connections are encrypted with certificate verification. Which combination best satisfies these requirements?
Correct Answer: AExplanationRow-level security with a policy keyed to the connecting user enforces row isolation inside the database, and table owners bypass policies unless FORCE ROW LEVEL SECURITY is set, so the table owner role must be handled carefully. sslmode=verify-full checks the server certificate and hostname, which mere require does not. Granting SELECT and UPDATE without row filtering allows the service account to read other patients' rows. Storing keys in postgresql.conf exposes them to administrators, and sslmode=prefer permits unencrypted fallback. Superuser for the service account is excessive and violates least privilege.
-
8 Question 8 Single choice Disaster Recovery
A financial services firm runs PostgreSQL 13 in its primary data center with a warm standby in a second region. The recovery objective is no more than 5 minutes of data loss, and the recovery time objective is 30 minutes. The standby currently uses asynchronous streaming replication and is reporting replay lag of about 40 minutes due to a long-running reporting query on the standby blocking replay. Which action best addresses the disaster recovery gap?
Correct Answer: AExplanationReplay conflicts with long-running standby queries cause the standby to fall behind, and max_standby_streaming_delay set to -1 lets replay wait indefinitely, which keeps the standby current but cancels nothing; moving heavy reporting to a separate logical replica fed through a replication slot removes the conflict from the disaster recovery standby. Increasing the delay makes lag worse, not better. hot_standby_feedback prevents cleanup on the primary but can cause bloat and does not stop replay from stalling on conflicts. Synchronous replication across regions would add commit latency and is not needed to meet a 5-minute loss target.
-
9 Question 9 Single choice Fundamental SQL
A data analyst has two tables: employees(id, name, dept_id) and departments(id, dept_name). Some employees have a NULL dept_id because they are not yet assigned. The analyst needs a list of all employees along with their department name, including unassigned employees, and must show NULL for the department name where no match exists. Which query returns the required result?
Correct Answer: AExplanationA LEFT JOIN keeps every row from the left table, employees, and fills department columns with NULL when no matching department exists, which covers unassigned employees. An INNER JOIN discards them. The RIGHT JOIN with a filter on non-null dept_id removes the unassigned employees and also keeps departments with no staff, which is wrong. A CROSS JOIN with that predicate still does not return unmatched employees as NULL-padded rows in the required way.
-
10 Question 10 Single choice Fundamental SQL
A reporting table sales(region, product, amount) in PostgreSQL 13 needs a summary showing total amount per region and per product, plus a grand total row, using a single query and no UNION ALL. The analyst wants NULL placeholders in the grouping columns for the subtotal and grand total rows. Which clause should be used?
Correct Answer: AExplanationROLLUP (region, product) produces hierarchical subtotals: region-level rows, and a grand total row, with NULLs in the grouping columns that are rolled up. CUBE would also add a product-only subtotal across all regions, which is not requested. GROUPING SETS (region, product) lists two separate groupings and produces no grand total. WITH TOTALS is not PostgreSQL syntax and is not a valid clause.
-
11 Question 11 Single choice Configuration Parameters
A PostgreSQL 13 cluster runs on storage where a checkpoint flush causes periodic I/O spikes that slow application writes. Monitoring shows most checkpoints are triggered by reaching max_wal_size rather than by the timeout. The team wants to spread checkpoint I/O more evenly without risking longer crash recovery than the current 10 minute target. Which change is most appropriate?
Correct Answer: AExplanationRaising max_wal_size lets the timeout rather than WAL volume trigger checkpoints, and checkpoint_completion_target controls how much of the interval the checkpoint writes are spread across. Together they smooth I/O while keeping checkpoint_timeout, and thus recovery time, roughly as planned. Reducing checkpoint_timeout increases checkpoint frequency and I/O pressure. Turning off full_page_writes risks corruption after a crash and is unsafe. wal_level minimal does not reduce checkpoint flushing and removes replication and archiving capability.
-
12 Question 12 Multiple choice Backup and Recovery Strategies
A PostgreSQL 13 team must be able to recover a database to a point before an accidental DROP TABLE that occurred at 14:05. They have a base backup taken at 02:00 and continuous WAL archives. Which TWO actions are required for this recovery to succeed? (Choose two.)
Correct Answer: A, CExplanationPoint-in-time recovery replays archived WAL from the base backup forward, so every segment from the backup start through the target must be retained and reachable. The restore must also declare recovery_target_time before the drop and provide restore_command so the server can fetch segments. VACUUM FULL is irrelevant to recovering a dropped table. A dump taken after the drop cannot supply the earlier definition, and hot_standby does not affect archive replay.
-
13 Question 13 Single choice Database Clusters
A company runs a PostgreSQL 13 primary with two asynchronous streaming replicas across availability zones. Their applications must never read data older than what the primary has committed for a user session that has just written, but they accept reads from replicas for other traffic. Writes must not wait for replicas, to preserve latency. Which design best meets these requirements?
Correct Answer: AExplanationAsynchronous replication lets commits proceed without waiting for replicas, preserving latency, and read-your-writes consistency is achieved at the application or connection router by directing a recently writing user to the primary for a short window. Synchronous settings make every commit wait on replicas, violating the latency requirement. Logical dumps are not a replication mechanism and would make replicas far behind.
-
14 Question 14 Single choice Database Maintenance
A busy OLTP table in PostgreSQL 13 has an index used by a unique constraint that has become bloated after heavy updates. The team must rebuild the index to reduce its size while the application continues to insert and update rows, and downtime must be avoided. Which command should be used?
Correct Answer: BExplanationREINDEX CONCURRENTLY rebuilds an index without blocking concurrent inserts, updates and deletes, at the cost of more total work. Plain REINDEX takes locks that block writes, and it cannot run inside a transaction block when it is concurrent or in some forms. Dropping and recreating the index without CONCURRENTLY blocks writes for the duration and also drops the constraint. VACUUM FULL takes an exclusive lock on the table and does not avoid blocking as claimed.
-
15 Question 15 Single choice Database Security
A security analyst at a company running PostgreSQL 13 finds that an application role was granted membership in a group role with broad privileges. Compliance requires that privileges be granted only through explicit, auditable paths and that no role can accidentally inherit privileges it does not need. The application login role must use only the privileges of a specific group role when needed, not automatically. Which role attribute should be applied to the application login role?
Correct Answer: BExplanationNOINHERIT stops a role from automatically using privileges of roles it is a member of, so the application must explicitly SET ROLE to the group role when it needs those privileges, which creates an auditable step. NOLOGIN would prevent the application from connecting at all. CREATEROLE grants the ability to create and alter roles, which widens privileges. BYPASSRLS removes row security protection, the opposite of what compliance needs.
-
16 Question 16 Single choice Configuration Parameters
An operations engineer must make a change to log_min_duration_statement on a PostgreSQL 13 cluster so that slow queries over 500 ms are logged on all new connections for the application database only. The change must be applied without restarting the server and must not affect other databases. The engineer has write access to postgresql.conf and to superuser SQL commands. Which approach is correct?
Correct Answer: CExplanationALTER DATABASE ... SET applies a parameter to new sessions connecting to that database only, so other databases are unaffected and no restart is needed. A postgresql.conf change with reload would apply cluster-wide, affecting all databases, which violates the scope requirement. A restart is unnecessary for this parameter, which can be reloaded or set per database. ALTER SYSTEM with restart is also cluster-wide and needlessly disruptive.
-
17 Question 17 Single choice Database Objects and Hierarchy
A database administrator maintains a schema in PostgreSQL 13 that contains a parent table orders partitioned by range on order_date, with monthly child partitions. Queries filtering on order_date are slow on the parent when the planner cannot exclude partitions. The team wants to confirm that partition pruning is applied and that the table hierarchy is correctly defined. Which action best verifies this?
Correct Answer: DExplanationEXPLAIN shows the plan the planner actually chooses, and with partition pruning active the plan lists only the child partitions that can satisfy the predicate. pg_inherits shows the hierarchy but says nothing about whether pruning happens at query time. Row counts in pg_class are estimates and do not reveal pruning. Unique indexes are not required for range pruning, which relies on partition bounds and predicates.
These are 17 of the 71 questions in the full PostgreSQL-Essentials pack.
Get All 71 QuestionsGet all 71 questions & answers
Full access options for EnterpriseDB PostgreSQL-Essentials
Self-study
PDF Version
- 71 actual exam questions
- Compatible with all devices
- Printable PDF format
- No download limits
- 90 days free updates
- 24/7 customer support
Best value
Bundle Pack
- Discounted PDF + online access
- 71 actual exam questions
- Both PDF and online practice test
- Free 90 days updates
- No download or practice limits
- 24/7 customer support
Exam simulation
Online Practice Test
- 71 actual exam questions
- Actual exam environment
- 90 days free updates
- Browser-based software
- 24/7 customer support
100% Money Back Guarantee
Your success comes first
At DumpsProvider, we give you a 100% money back guarantee on all of our exam dumps. For us, your success is the #1 priority and we are more than confident that our exam material will help you pass the PostgreSQL-Essentials Exam (PostgreSQL Essentials Certification v13) on your very first attempt.
In a rare case, if you fail your exam, we will refund your amount without asking a single question.