PROFESSIONAL-CLOUD-DATABASE-ENGINEER · Question #166
You are the DBA of your organization. You provided a cloned instance from the production Cloud SQL for PostgreSQL database to the developers for testing purposes. After the creation of the clone, your
The correct answer is D. The most likely cause of missing data in a recently altered table in Cloud SQL for PostgreSQL is that the table was set to UNLOGGED after an ALTER TABLE statement. In PostgreSQL, UNLOGGED tables bypass Write-Ahead Logging (WAL), which means their data is
Question
You are the DBA of your organization. You provided a cloned instance from the production Cloud SQL for PostgreSQL database to the developers for testing purposes. After the creation of the clone, your developers notice missing data in one of the recently altered tables. What should you do to ensure that all data is included-
Options
- ATake a back up of the production database, and restore it to another Cloud SQL for PostgreSQL
- BCheck for missing roles and privileges in the cloned Cloud SQL instance. Grant missing privileges
- CClone the current production database, and restore it to an earlier point-in-time (PITR). Provide
- DDump the production database to a file. Modify the dumped file to ALTER TABLE to SET LOGGED
Explanation
The correct answer is D. The most likely cause of missing data in a recently altered table in Cloud SQL for PostgreSQL is that the table was set to UNLOGGED after an ALTER TABLE statement. In PostgreSQL, UNLOGGED tables bypass Write-Ahead Logging (WAL), which means their data is excluded from cloning and replication operations. The fix is to dump the production database, modify the dump file to ALTER TABLE ... SET LOGGED for the affected table, and then restore it. This ensures the restored instance treats the table as a regular logged table with full WAL coverage, capturing all data. Option A (backup/restore of the same production state) would reproduce the same problem. Option B (roles/privileges) addresses access control, not missing data. Option C (PITR) would retrieve an older state, not fix the root cause.
Topics
Community Discussion
No community discussion yet for this question.