Closed abizermamnoon closed 7 months ago
Problem 55: table u
has a FOREIGN KEY constraint on table t
. That means that whenever you INSERT INTO u
, you need to run a corresponding SELECT statement on t
in order to figure out if the INSERT violates the constraint. This "hidden" SELECT is generating this For Key Share lock.
Problem 64:
u
. No check of table t
is performed because of the DEFERRABLE INITIALLY DEFERRED line in the FOREIGN KEY constraint.t
in exclusive mode.t
. Running this SELECT blocks because of the EXCLUSIVE LOCK created on line 9.
Hi Mike,
In Problem 55, after line 7, I executed this command to find row level locks:
Is this row level lock generated by table u somehow?
In Problem 64, on line 10, my hypothesis was that an error would be thrown because u = 8 is not in table t. However, it got blocked. Why did it get blocked?