MCPcopy Create free account
hub / github.com/apache/cloudberry / table_openrv

Function table_openrv

src/backend/access/table/table.c:106–126  ·  view source on GitHub ↗

---------------- * table_openrv - open a table relation specified * by a RangeVar node * * As above, but relation is specified by a RangeVar. * ---------------- */

Source from the content-addressed store, hash-verified

104 * ----------------
105 */
106Relation
107table_openrv(const RangeVar *relation, LOCKMODE lockmode)
108{
109 Relation r;
110
111 r = relation_openrv(relation, lockmode);
112
113 if (r->rd_rel->relkind == RELKIND_INDEX ||
114 r->rd_rel->relkind == RELKIND_PARTITIONED_INDEX)
115 ereport(ERROR,
116 (errcode(ERRCODE_WRONG_OBJECT_TYPE),
117 errmsg("\"%s\" is an index",
118 RelationGetRelationName(r))));
119 else if (r->rd_rel->relkind == RELKIND_COMPOSITE_TYPE)
120 ereport(ERROR,
121 (errcode(ERRCODE_WRONG_OBJECT_TYPE),
122 errmsg("\"%s\" is a composite type",
123 RelationGetRelationName(r))));
124
125 return r;
126}
127
128/* ----------------
129 * table_openrv_extended - open a table relation specified

Callers 15

paxProcessUtilityFunction · 0.85
get_rel_from_relnameFunction · 0.85
currtid_byrelnameFunction · 0.85
DoCopyFunction · 0.85
CreateTriggerFiringOnFunction · 0.85
OpenTableListFunction · 0.85
ATExecAddInheritFunction · 0.85
ATExecDropInheritFunction · 0.85
ATExecAttachPartitionFunction · 0.85
ATExecDetachPartitionFunction · 0.85

Calls 3

relation_openrvFunction · 0.85
errcodeFunction · 0.50
errmsgFunction · 0.50

Tested by

no test coverage detected