35 List *ancestor_views);
51 bool recurse = rv->
inh;
87 if (relkind != RELKIND_RELATION && relkind != RELKIND_PARTITIONED_TABLE &&
88 relkind != RELKIND_VIEW)
90 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
91 errmsg(
"cannot lock relation \"%s\"",
100 if (relpersistence == RELPERSISTENCE_TEMP)
124 foreach(lc, children)
129 if (childreloid == reloid)
142 (
errcode(ERRCODE_LOCK_NOT_AVAILABLE),
143 errmsg(
"could not obtain lock on relation \"%s\"",
187 foreach(rtable, query->
rtable)
193 char relkind = rte->relkind;
197 if (relkind != RELKIND_RELATION && relkind != RELKIND_PARTITIONED_TABLE &&
198 relkind != RELKIND_VIEW)
222 (
errcode(ERRCODE_LOCK_NOT_AVAILABLE),
223 errmsg(
"could not obtain lock on relation \"%s\"",
226 if (relkind == RELKIND_VIEW)
246 List *ancestor_views)
AclMode aclmask(const Acl *acl, Oid roleid, Oid ownerId, AclMode mask, AclMaskHow how)
void aclcheck_error(AclResult aclerr, ObjectType objtype, const char *objectname)
AclResult pg_class_aclcheck(Oid table_oid, Oid roleid, AclMode mode)
#define OidIsValid(objectId)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
List * lappend_oid(List *list, Oid datum)
bool list_member_oid(const List *list, Oid datum)
List * list_delete_last(List *list)
bool ConditionalLockRelationOid(Oid relid, LOCKMODE lockmode)
void UnlockRelationOid(Oid relid, LOCKMODE lockmode)
void LockRelationOid(Oid relid, LOCKMODE lockmode)
static AclResult LockTableAclCheck(Oid reloid, LOCKMODE lockmode, Oid userid)
static void RangeVarCallbackForLockTable(const RangeVar *rv, Oid relid, Oid oldrelid, void *arg)
void LockTableCommand(LockStmt *lockstmt)
static void LockViewRecurse(Oid reloid, LOCKMODE lockmode, bool nowait, List *ancestor_views)
static bool LockViewRecurse_walker(Node *node, LockViewRecurse_context *context)
static void LockTableRecurse(Oid reloid, LOCKMODE lockmode, bool nowait)
char get_rel_persistence(Oid relid)
char get_rel_relkind(Oid relid)
char * get_rel_name(Oid relid)
Oid RangeVarGetRelidExtended(const RangeVar *relation, LOCKMODE lockmode, uint32 flags, RangeVarGetRelidCallback callback, void *callback_arg)
#define query_tree_walker(q, w, c, f)
#define expression_tree_walker(n, w, c)
#define QTW_IGNORE_JOINALIASES
#define IsA(nodeptr, _type_)
ObjectType get_relkind_objtype(char relkind)
int errdetail_relkind_not_supported(char relkind)
List * find_all_inheritors(Oid parentrelId, LOCKMODE lockmode, List **numparents)
static Datum ObjectIdGetDatum(Oid X)
#define RelationHasSecurityInvoker(relation)
Query * get_view_query(Relation view)
#define SearchSysCacheExists1(cacheId, key1)
void table_close(Relation relation, LOCKMODE lockmode)
Relation table_open(Oid relationId, LOCKMODE lockmode)
#define XACT_FLAGS_ACCESSEDTEMPNAMESPACE