Bird
0
0

Why is it important for a PostgreSQL audit trigger function to return NEW or OLD appropriately?

hard📝 Conceptual Q10 of 15
PostgreSQL - Triggers in PostgreSQL
Why is it important for a PostgreSQL audit trigger function to return NEW or OLD appropriately?
ABecause it controls the audit log table structure
BBecause it speeds up query execution
CBecause it changes user permissions automatically
DBecause returning the wrong value can prevent the original operation from completing
Step-by-Step Solution
Solution:
  1. Step 1: Understand trigger function return values

    Row-level triggers must return NEW for INSERT/UPDATE to proceed or OLD for DELETE; wrong return can abort operation.
  2. Step 2: Recognize impact of incorrect return

    Returning incorrect value can block or alter the original data change, causing errors or data loss.
  3. Final Answer:

    Because returning the wrong value can prevent the original operation from completing -> Option D
  4. Quick Check:

    Correct return value ensures operation success [OK]
Quick Trick: Return NEW or OLD correctly to avoid blocking operations [OK]
Common Mistakes:
  • Ignoring return value importance
  • Assuming return affects audit table only
  • Thinking return controls permissions or speed

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes