Bird
0
0

In PostgreSQL's MVCC, what does a transaction see when it queries data?

easy📝 Conceptual Q2 of 15
PostgreSQL - Transactions and Concurrency
In PostgreSQL's MVCC, what does a transaction see when it queries data?
AAll data including uncommitted changes from other transactions
BOnly the data modified by itself
COnly the committed data as of the transaction start time
DThe latest data regardless of commit status
Step-by-Step Solution
Solution:
  1. Step 1: Recall MVCC snapshot behavior

    Each transaction sees a consistent snapshot of the database as it was at the start of the transaction.
  2. Step 2: Understand visibility rules

    This means it sees only committed data up to that point, ignoring uncommitted changes from others.
  3. Final Answer:

    Only the committed data as of the transaction start time -> Option C
  4. Quick Check:

    Transaction snapshot = committed data at start [OK]
Quick Trick: Transactions see a fixed snapshot at start [OK]
Common Mistakes:
  • Thinking uncommitted data is visible
  • Assuming transactions see latest data instantly
  • Confusing own changes with others'

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes