Re: locks in CREATE TRIGGER, ADD FK
От | Tom Lane |
---|---|
Тема | Re: locks in CREATE TRIGGER, ADD FK |
Дата | |
Msg-id | 1420.1111550778@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: locks in CREATE TRIGGER, ADD FK (Neil Conway <neilc@samurai.com>) |
Список | pgsql-hackers |
Neil Conway <neilc@samurai.com> writes: > /* > ! * Grab an exclusive lock on the pk table, so that someone doesn't > ! * delete rows out from under us. (Although a lesser lock would do for > ! * that purpose, we'll need exclusive lock anyway to add triggers to > ! * the pk table; trying to start with a lesser lock will just create a > ! * risk of deadlock.) > */ > ! pkrel = heap_openrv(fkconstraint->pktable, AccessExclusiveLock); > /* > * Validity and permissions checks > --- 3829,3839 ---- > Oid constrOid; > /* > ! * Grab a lock on the pk table, so that someone doesn't delete > ! * rows out from under us; ShareRowExclusive should be good > ! * enough. > */ BTW, the above comment change is seriously inadequate, because it removes the explanation of *why* that is the minimum required lock. regards, tom lane
В списке pgsql-hackers по дате отправления: