Bird
0
0

What is the main purpose of a trigger in PostgreSQL for audit logging?

easy📝 Conceptual Q11 of 15
PostgreSQL - Triggers in PostgreSQL
What is the main purpose of a trigger in PostgreSQL for audit logging?
ATo backup the database periodically
BTo automatically record changes made to data in a table
CTo create new tables automatically
DTo speed up query execution
Step-by-Step Solution
Solution:
  1. Step 1: Understand what triggers do

    Triggers run code automatically when data changes occur in a table.
  2. Step 2: Connect triggers to audit logging

    Audit logging means recording who changed what and when, which triggers help automate.
  3. Final Answer:

    To automatically record changes made to data in a table -> Option B
  4. Quick Check:

    Trigger = automatic audit record [OK]
Quick Trick: Triggers run code on data changes to log audits [OK]
Common Mistakes:
  • Thinking triggers speed up queries
  • Confusing triggers with backups
  • Assuming triggers create tables

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes