Bird
0
0

You want to replicate only INSERT and UPDATE changes but not DELETEs on a table using logical replication. Which approach is correct?

hard📝 Application Q8 of 15
PostgreSQL - Advanced Features
You want to replicate only INSERT and UPDATE changes but not DELETEs on a table using logical replication. Which approach is correct?
ALogical replication cannot filter change types
BCreate a publication with FOR TABLE table_name WITH (publish = 'all') and filter deletes on subscriber
CCreate a publication with FOR TABLE table_name WITH (publish = 'insert, update')
DCreate a publication with FOR TABLE table_name WITH (publish = 'insert, delete')
Step-by-Step Solution
Solution:
  1. Step 1: Recall publication options for change types

    PostgreSQL allows specifying which change types to publish using the publish option.
  2. Step 2: Match option to requirement

    Create a publication with FOR TABLE table_name WITH (publish = 'insert, update') correctly uses publish = 'insert, update' to exclude deletes.
  3. Final Answer:

    Create a publication with FOR TABLE table_name WITH (publish = 'insert, update') -> Option C
  4. Quick Check:

    Use publish option to filter change types [OK]
Quick Trick: Use publish option to select change types in publication [OK]
Common Mistakes:
  • Thinking filtering must be done on subscriber
  • Using wrong publish values
  • Assuming logical replication cannot filter changes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes