PostgreSQL Source Code  git master
lockcmds.h File Reference
#include "nodes/parsenodes.h"
Include dependency graph for lockcmds.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void LockTableCommand (LockStmt *lockstmt)
 

Function Documentation

◆ LockTableCommand()

void LockTableCommand ( LockStmt lockstmt)

Definition at line 42 of file lockcmds.c.

43 {
44  ListCell *p;
45 
46  /*
47  * Iterate over the list and process the named relations one at a time
48  */
49  foreach(p, lockstmt->relations)
50  {
51  RangeVar *rv = (RangeVar *) lfirst(p);
52  bool recurse = rv->inh;
53  Oid reloid;
54 
55  reloid = RangeVarGetRelidExtended(rv, lockstmt->mode,
56  lockstmt->nowait ? RVR_NOWAIT : 0,
58  (void *) &lockstmt->mode);
59 
60  if (get_rel_relkind(reloid) == RELKIND_VIEW)
61  LockViewRecurse(reloid, lockstmt->mode, lockstmt->nowait, NIL);
62  else if (recurse)
63  LockTableRecurse(reloid, lockstmt->mode, lockstmt->nowait);
64  }
65 }
static void RangeVarCallbackForLockTable(const RangeVar *rv, Oid relid, Oid oldrelid, void *arg)
Definition: lockcmds.c:72
static void LockViewRecurse(Oid reloid, LOCKMODE lockmode, bool nowait, List *ancestor_views)
Definition: lockcmds.c:246
static void LockTableRecurse(Oid reloid, LOCKMODE lockmode, bool nowait)
Definition: lockcmds.c:118
char get_rel_relkind(Oid relid)
Definition: lsyscache.c:2007
Oid RangeVarGetRelidExtended(const RangeVar *relation, LOCKMODE lockmode, uint32 flags, RangeVarGetRelidCallback callback, void *callback_arg)
Definition: namespace.c:382
@ RVR_NOWAIT
Definition: namespace.h:72
#define lfirst(lc)
Definition: pg_list.h:172
#define NIL
Definition: pg_list.h:68
unsigned int Oid
Definition: postgres_ext.h:31
bool nowait
Definition: parsenodes.h:3797
List * relations
Definition: parsenodes.h:3795
bool inh
Definition: primnodes.h:85

References get_rel_relkind(), RangeVar::inh, lfirst, LockTableRecurse(), LockViewRecurse(), LockStmt::mode, NIL, LockStmt::nowait, RangeVarCallbackForLockTable(), RangeVarGetRelidExtended(), LockStmt::relations, and RVR_NOWAIT.

Referenced by standard_ProcessUtility().