#include "nodes/parsenodes.h"

Go to the source code of this file.
Functions | |
| void | LockTableCommand (LockStmt *lockstmt) |
| void LockTableCommand | ( | LockStmt * | lockstmt | ) |
Definition at line 37 of file lockcmds.c.
References RangeVar::inhOpt, interpretInhOption(), lfirst, LockTableRecurse(), LockStmt::mode, LockStmt::nowait, PreventCommandDuringRecovery(), RangeVarCallbackForLockTable(), RangeVarGetRelidExtended(), LockStmt::relations, and RowExclusiveLock.
Referenced by standard_ProcessUtility().
{
ListCell *p;
/*---------
* During recovery we only accept these variations:
* LOCK TABLE foo IN ACCESS SHARE MODE
* LOCK TABLE foo IN ROW SHARE MODE
* LOCK TABLE foo IN ROW EXCLUSIVE MODE
* This test must match the restrictions defined in LockAcquireExtended()
*---------
*/
if (lockstmt->mode > RowExclusiveLock)
PreventCommandDuringRecovery("LOCK TABLE");
/*
* Iterate over the list and process the named relations one at a time
*/
foreach(p, lockstmt->relations)
{
RangeVar *rv = (RangeVar *) lfirst(p);
bool recurse = interpretInhOption(rv->inhOpt);
Oid reloid;
reloid = RangeVarGetRelidExtended(rv, lockstmt->mode, false,
lockstmt->nowait,
RangeVarCallbackForLockTable,
(void *) &lockstmt->mode);
if (recurse)
LockTableRecurse(reloid, lockstmt->mode, lockstmt->nowait);
}
}
1.7.1