PGCES-02 · Question #86
Table "t1" is defined below. Table "t1" has a column "id" of type INTEGER, and a column "name" of type TEXT. t1: The following SQL is executed while client "A" is connected. BEGIN; SELECT FROM t1…
The correct answer is B. The update process for client "B" is blocked until the current transaction for client "A" is. See the full explanation below for the reasoning.
Question
Table "t1" is defined below. Table "t1" has a column "id" of type INTEGER, and a column "name" of type TEXT. t1:
The following SQL is executed while client "A" is connected. BEGIN; SELECT * FROM t1 WHERE id = 2 FOR UPDATE; PostgreSQL CE PGCES-02 Exam SELECT * FROM t1 WHERE id = 1 FOR UPDATE; -- () While the second 'SELECT' statement, shown with (), is being executed, a separate client "B" connects and executes the following SQL. Select the correct statement about the execution results. UPDATE t1 SET name = 'turtle' WHERE id = 2; Note: the default transaction isolation level is set to "read committed".
Options
- AThe update process for client "B" is blocked until the current connection for client "A" is
- BThe update process for client "B" is blocked until the current transaction for client "A" is
- CThe 'UPDATE' process for client "B" proceeds regardless of the condition of client "A".
- DThe process of client "B" immediately generates an error.
- EThe processes for both clients are blocked, and an error stating that a deadlock has been
How the community answered
(32 responses)- A9% (3)
- B81% (26)
- D3% (1)
- E6% (2)
Community Discussion
No community discussion yet for this question.