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

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

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().