Bird
0
0

You wrote this command to set the isolation level but get an error: SET TRANSACTION LEVEL = READ COMMITTED; What is the error and how to fix it?

medium📝 Debug Q14 of 15
PostgreSQL - Transactions and Concurrency
You wrote this command to set the isolation level but get an error: SET TRANSACTION LEVEL = READ COMMITTED; What is the error and how to fix it?
ASyntax error: remove '=' and use 'ISOLATION' keyword
BWrong isolation level name, use 'READ COMMIT' instead
CMissing semicolon at end of statement
DSET TRANSACTION cannot be used inside a transaction
Step-by-Step Solution
Solution:
  1. Step 1: Identify syntax error

    The command incorrectly uses '=' and omits 'ISOLATION' keyword.
  2. Step 2: Correct syntax

    The correct command is SET TRANSACTION ISOLATION LEVEL READ COMMITTED; without '='.
  3. Final Answer:

    Syntax error: remove '=' and use 'ISOLATION' keyword -> Option A
  4. Quick Check:

    Correct syntax requires 'ISOLATION' and no '=' [OK]
Quick Trick: No '=' sign; use 'ISOLATION' keyword in SET TRANSACTION [OK]
Common Mistakes:
  • Using '=' sign in SET TRANSACTION
  • Misspelling isolation level names
  • Trying to set isolation level outside allowed scope

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes