Docsity

[EDBPA13] EDB PostgreSQL 13 Associate Certification Exam Guide, Exams of Technology

Toggle sidebar
bg1
[EDBPA13] EDB PostgreSQL 13 Associate
Certification Exam Guide
**Question 1.** Which PostgreSQL process is responsible for writing dirty shared buffers to
disk?
A) autovacuum launcher
B) walwriter
C) background writer
D) checkpointer
Answer: C
Explanation: The background writer (also called the writer) periodically flushes dirty pages from
shared buffers to the operating system cache, reducing the workload of the checkpointer.
**Question 2.** In PostgreSQL memory architecture, which parameter controls the amount of
memory used for sorting operations and hash tables for each query?
A) shared_buffers
B) work_mem
C) maintenance_work_mem
D) temp_buffers
Answer: B
Explanation: work_mem specifies the memory available for internal sort operations and hash
tables per query operation. Exceeding it causes temporary files on disk.
**Question 3.** The $PGDATA/base directory contains:
A) configuration files such as postgresql.conf
B) per-database tablespace data files
C) WAL segment files
D) authentication rules
Answer: B
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b

Partial preview of the text

Download [EDBPA13] EDB PostgreSQL 13 Associate Certification Exam Guide and more Exams Technology in PDF only on Docsity!

Certification Exam Guide

Question 1. Which PostgreSQL process is responsible for writing dirty shared buffers to disk? A) autovacuum launcher B) walwriter C) background writer D) checkpointer Answer: C Explanation: The background writer (also called the writer) periodically flushes dirty pages from shared buffers to the operating system cache, reducing the workload of the checkpointer. Question 2. In PostgreSQL memory architecture, which parameter controls the amount of memory used for sorting operations and hash tables for each query? A) shared_buffers B) work_mem C) maintenance_work_mem D) temp_buffers Answer: B Explanation: work_mem specifies the memory available for internal sort operations and hash tables per query operation. Exceeding it causes temporary files on disk. Question 3. The $PGDATA/base directory contains: A) configuration files such as postgresql.conf B) per-database tablespace data files C) WAL segment files D) authentication rules Answer: B

Certification Exam Guide

Explanation: The base directory holds subdirectories named by database OIDs, each containing the data files for that database’s tables and indexes. Question 4. Which object hierarchy level directly contains tables and indexes? A) Instance B) Database C) Schema D) Tablespace Answer: C Explanation: Within a database, schemas organize objects; tables and indexes reside inside schemas. Question 5. When initializing a new cluster with initdb, which option sets the default text encoding? A) – locale B) – encoding C) – data-checksums D) – auth-local Answer: B Explanation: The – encoding flag specifies the default character set for the cluster, e.g., UTF8. Question 6. Which command starts a PostgreSQL server in foreground mode, useful for debugging? A) pg_ctl start – D $PGDATA – l logfile B) postgres – D $PGDATA C) systemctl start postgresql

Certification Exam Guide

A) trust B) md C) password D) scram-sha- 256 Answer: D Explanation: The scram-sha-256 method uses the SCRAM authentication protocol, providing stronger password storage than md5. Question 10. A change to which of the following parameters requires a full server restart? A) log_min_duration_statement B) shared_buffers C) max_parallel_workers_per_gather D) autovacuum_naptime Answer: B Explanation: shared_buffers is allocated at server start; changing it needs a restart, while the others can be reloaded with SIGHUP. Question 11. Which role attribute allows a role to bypass all permission checks? A) CREATEDB B) CREATEROLE C) SUPERUSER D) LOGIN Answer: C Explanation: The SUPERUSER attribute grants unrestricted access, ignoring all GRANT/REVOKE permissions.

Certification Exam Guide

Question 12. What is the default schema that is searched first for unqualified object names? A) pg_catalog B) public C) information_schema D) pg_temp Answer: B Explanation: The public schema is part of the search_path by default, making its objects visible without qualification. Question 13. Which command revokes the ability of a role to create new databases? A) REVOKE CREATEDB FROM role; B) ALTER ROLE role NOCREATEDB; C) REVOKE CREATE DATABASE FROM role; D) ALTER ROLE role NOLOGIN; Answer: B Explanation: ALTER ROLE … NOCREATEDB removes the CREATEDB attribute from the role. Question 14. What does the VACUUM command primarily do? A) Rewrites the entire table to compact it B) Removes dead tuples and updates visibility maps C) Recalculates statistics for the planner D) Locks the table for exclusive access Answer: B Explanation: VACUUM scans a table, marks dead tuples as reusable, and updates the visibility map, freeing space without rewriting the whole table.

Certification Exam Guide

Explanation: REINDEX recreates the index from scratch, eliminating bloat. Question 18. Which backup method produces a logical dump that can be restored on a different major version? A) pg_basebackup B) pg_dump/pg_dumpall C) file system copy while server is stopped D) continuous WAL archiving Answer: B Explanation: pg_dump creates a logical SQL script; it can be restored on newer major versions, unlike physical file‑system backups. Question 19. What does the recovery.signal file indicate to PostgreSQL? A) That the server should start in standby mode B) That the server should perform point‑in‑time recovery on next restart C) That the server should shut down immediately D) That WAL archiving is disabled Answer: B Explanation: Presence of recovery.signal triggers recovery mode on restart, allowing PITR using restore_command and recovery_target settings. Question 20. Which command creates a physical base backup of a running PostgreSQL server? A) pg_dumpall > backup.sql B) pg_basebackup - D /path/to/backup - Fp - Xs - P C) rsync - a $PGDATA /path/to/backup

Certification Exam Guide

D) pg_dump - Fc - f backup.dump Answer: B Explanation: pg_basebackup connects to the server, streams a consistent copy of the data directory, and optionally includes WAL files. Question 21. In pg_stat_activity, the column "state" shows “idle in transaction”. What does this indicate? A) The backend is waiting for a client query B) The backend is executing a query C) The backend has an open transaction with no current query D) The backend is idle and has no transaction open Answer: C Explanation: “idle in transaction” means a client opened a transaction, the server is waiting for further commands, which can hold locks and bloat MVCC. Question 22. Which EXPLAIN option provides actual execution times in addition to the plan? A) EXPLAIN VERBOSE B) EXPLAIN ANALYZE C) EXPLAIN BUFFERS D) EXPLAIN COSTS Answer: B Explanation: EXPLAIN ANALYZE runs the query and reports real timing and row count data. Question 23. To log every statement that takes longer than 500 ms, which setting is used? A) log_statement = 'all'

Certification Exam Guide

A) Enforcing foreign key constraints B) Generating unique identifiers automatically C) Storing large binary objects D) Maintaining transaction logs Answer: B Explanation: Sequences provide monotonically increasing numbers, often used as default values for serial columns. Question 27. Which command starts a new transaction block? A) BEGIN; B) START TRANSACTION; C) Both A and B are valid D) COMMIT; Answer: C Explanation: PostgreSQL accepts both BEGIN and START TRANSACTION to begin a transaction. Question 28. What is the purpose of a SAVEPOINT within a transaction? A) To permanently commit the transaction B) To create a named point to which the transaction can roll back C) To lock a table for exclusive access D) To flush the transaction log to disk Answer: B Explanation: SAVEPOINT allows partial rollback to a specific point without aborting the whole transaction.

Certification Exam Guide

Question 29. Which psql meta‑command lists all tables in the current database? A) \dt B) \d+ C) \l D) \du Answer: A Explanation: \dt displays relations of type table in the current search_path. Question 30. How can you change the password of a role named “alice”? A) ALTER ROLE alice WITH PASSWORD 'newpwd'; B) SET PASSWORD FOR alice = 'newpwd'; C) UPDATE pg_authid SET rolpassword='newpwd' WHERE rolname='alice'; D) GRANT PASSWORD 'newpwd' TO alice; Answer: A Explanation: ALTER ROLE … WITH PASSWORD changes the stored encrypted password for the role. Question 31. Which parameter controls the frequency of checkpoint writes? A) checkpoint_timeout B) checkpoint_completion_target C) checkpoint_segments D) checkpoint_flush_after Answer: A Explanation: checkpoint_timeout sets the maximum time between automatic checkpoints.

Certification Exam Guide

Question 35. Which configuration file can be edited by superusers to map operating‑system usernames to database roles? A) pg_hba.conf B) pg_ident.conf C) postgresql.conf D) pg_service.conf Answer: B Explanation: pg_ident.conf defines ident mappings between system usernames and PostgreSQL roles. Question 36. If you set “max_worker_processes” to a higher value than the number of CPU cores, what is the likely effect? A) Improved parallel query performance B) Increased context‑switch overhead without real benefit C) Automatic use of more shared_buffers D) Disabling of autovacuum workers Answer: B Explanation: More worker processes than cores cause more scheduling overhead, potentially degrading performance. Question 37. Which command will list all roles that have the CREATEROLE attribute? A) SELECT rolname FROM pg_roles WHERE rolcreaterole; B) \du+ C) SELECT * FROM pg_user WHERE usesuper; D) SELECT * FROM pg_roles WHERE rolcanlogin;

Certification Exam Guide

Answer: A Explanation: The rolcreaterole column indicates whether the role can create other roles. Question 38. What is the effect of setting “default_transaction_isolation” to “serializable”? A) All new transactions will use the highest isolation level, preventing phantom reads B) Transactions will ignore row‑level locks C) The server will automatically enable logical replication D) The setting only affects read‑only transactions Answer: A Explanation: serializable is the strictest isolation level, ensuring full ACID compliance by preventing anomalies such as phantom reads. Question 39. In PostgreSQL, which of the following is true about BRIN indexes? A) They are best for very large tables with naturally ordered data B) They store the entire column values in the index leaf pages C) They are always faster than B‑tree indexes for point lookups D) They require a separate tablespace for each index Answer: A Explanation: BRIN (Block Range INdexes) summarize ranges of physical blocks, making them efficient for large, ordered datasets. Question 40. Which SQL statement adds a CHECK constraint to ensure column “price” is non‑negative? A) ALTER TABLE products ADD CONSTRAINT price_nonneg CHECK (price >= 0); B) CREATE CONSTRAINT price_nonneg ON products (price >= 0); C) ALTER TABLE products MODIFY price CHECK (price >= 0);

Certification Exam Guide

A) default_tablespace in postgresql.conf B) default_storage in pg_hba.conf C) temp_tablespaces in postgresql.conf D) search_path in pg_ident.conf Answer: A Explanation: default_tablespace specifies the tablespace used when CREATE DATABASE does not explicitly name one. Question 44. Which of the following statements about logical replication is correct? A) It replicates the entire cluster including system catalogs B) It uses WAL files to stream changes to the subscriber C) It replicates at the level of individual tables or publications D) It requires the same major version on publisher and subscriber Answer: C Explanation: Logical replication works with publications and subscriptions, allowing selective table-level replication. Question 45. If you want to prevent a specific role from connecting to a database, which command should you use? A) REVOKE CONNECT ON DATABASE dbname FROM role; B) ALTER ROLE role NOLOGIN; C) REVOKE ALL PRIVILEGES ON DATABASE dbname FROM role; D) DROP ROLE role; Answer: B Explanation: NOLOGIN removes the ability of the role to initiate a session, effectively blocking connections.

Certification Exam Guide

Question 46. What does the “pg_restore – j 4” option do? A) Restores the dump using four parallel jobs (workers) B) Joins the dump with another file before restoring C) Forces a full vacuum after restore D) Limits the restore to 4 GB of data Answer: A Explanation: – j specifies the number of parallel worker processes for restoring a custom‑format dump. Question 47. Which function can be used to convert a timestamp to epoch seconds? A) date_part('epoch', timestamp) B) to_epoch(timestamp) C) epoch(timestamp) D) extract(epoch FROM timestamp) Answer: D Explanation: The standard syntax is extract(epoch FROM timestamp) or date_part('epoch', timestamp); both return seconds since 1970‑ 01 ‑01. Question 48. In a partitioned table, which command detaches a child table from its parent? A) ALTER TABLE child DETACH PARTITION; B) ALTER TABLE parent DETACH PARTITION child; C) DROP PARTITION child; D) ALTER TABLE child SET UNPARTITIONED; Answer: B

Certification Exam Guide

C) ALTER TABLESPACE fast_ts SET LOCATION '/mnt/fastdata'; D) CREATE SCHEMA fast_ts LOCATION '/mnt/fastdata'; Answer: A Explanation: CREATE TABLESPACE … LOCATION specifies the directory for the tablespace files. Question 52. In pg_stat_activity, the column “backend_xid” shows: A) The transaction ID of the current query B) The process ID of the backend C) The session start timestamp D) The current WAL LSN being written Answer: A Explanation: backend_xid is the transaction ID associated with the backend’s current transaction, if any. Question 53. Which setting determines the maximum size of a single WAL segment file? A) wal_segment_size B) wal_file_size C) max_wal_size D) wal_keep_segments Answer: A Explanation: wal_segment_size (default 16 MB) defines the size of each WAL file; it is set at initdb time and cannot be changed later. Question 54. Which of the following statements about the “pgcrypto” extension is true? A) It provides functions for encryption, decryption, and hashing

Certification Exam Guide

B) It is required for logical replication C) It replaces the need for WAL archiving D) It is automatically loaded in all databases Answer: A Explanation: pgcrypto adds cryptographic functions such as pgp_sym_encrypt, digest, etc. Question 55. What does the “ALTER SYSTEM SET …” command do? A) Modifies postgresql.conf and reloads the configuration automatically B) Writes the parameter change to postgresql.auto.conf, requiring a reload or restart C) Changes the setting for the current session only D) Directly updates the shared memory value without touching files Answer: B Explanation: ALTER SYSTEM writes the change to postgresql.auto.conf, which is read on server reload; a restart may be needed for some parameters. Question 56. Which command can be used to list all active replication slots? A) SELECT * FROM pg_replication_slots; B) \dx replication_slots C) SHOW replication_slots; D) SELECT * FROM pg_stat_replication; Answer: A Explanation: pg_replication_slots catalog view lists defined replication slots and their state. Question 57. In a multi‑tenant environment, which approach best isolates data per client? A) Separate PostgreSQL clusters on different ports