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 41 of file lockcmds.c.

42 {
43  ListCell *p;
44 
45  /*
46  * Iterate over the list and process the named relations one at a time
47  */
48  foreach(p, lockstmt->relations)
49  {
50  RangeVar *rv = (RangeVar *) lfirst(p);
51  bool recurse = rv->inh;
52  Oid reloid;
53 
54  reloid = RangeVarGetRelidExtended(rv, lockstmt->mode,
55  lockstmt->nowait ? RVR_NOWAIT : 0,
57  &lockstmt->mode);
58 
59  if (get_rel_relkind(reloid) == RELKIND_VIEW)
60  LockViewRecurse(reloid, lockstmt->mode, lockstmt->nowait, NIL);
61  else if (recurse)
62  LockTableRecurse(reloid, lockstmt->mode, lockstmt->nowait);
63  }
64 }
static void RangeVarCallbackForLockTable(const RangeVar *rv, Oid relid, Oid oldrelid, void *arg)
Definition: lockcmds.c:71
static void LockViewRecurse(Oid reloid, LOCKMODE lockmode, bool nowait, List *ancestor_views)
Definition: lockcmds.c:245
static void LockTableRecurse(Oid reloid, LOCKMODE lockmode, bool nowait)
Definition: lockcmds.c:117
char get_rel_relkind(Oid relid)
Definition: lsyscache.c:2003
Oid RangeVarGetRelidExtended(const RangeVar *relation, LOCKMODE lockmode, uint32 flags, RangeVarGetRelidCallback callback, void *callback_arg)
Definition: namespace.c:441
@ RVR_NOWAIT
Definition: namespace.h:73
#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:3975
List * relations
Definition: parsenodes.h:3973
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().