PostgreSQL Source Code git master
Loading...
Searching...
No Matches
propgraphcmds.h File Reference
Include dependency graph for propgraphcmds.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

ObjectAddress CreatePropGraph (ParseState *pstate, const CreatePropGraphStmt *stmt)
 
ObjectAddress AlterPropGraph (ParseState *pstate, const AlterPropGraphStmt *stmt)
 

Function Documentation

◆ AlterPropGraph()

ObjectAddress AlterPropGraph ( ParseState pstate,
const AlterPropGraphStmt stmt 
)
extern

Definition at line 1293 of file propgraphcmds.c.

1294{
1295 Oid pgrelid;
1296 ListCell *lc;
1298
1299 /*
1300 * ShareRowExclusiveLock is required because this command runs some
1301 * graph-wide consistency checks that wouldn't work if more than one ALTER
1302 * PROPERTY GRAPH could operate on the same graph at once.
1303 */
1306 stmt->missing_ok ? RVR_MISSING_OK : 0,
1308 NULL);
1309 if (pgrelid == InvalidOid)
1310 {
1312 (errmsg("relation \"%s\" does not exist, skipping",
1313 stmt->pgname->relname)));
1314 return InvalidObjectAddress;
1315 }
1316
1318
1319 foreach(lc, stmt->add_vertex_tables)
1320 {
1322 struct element_info *vinfo;
1323 Relation rel;
1324 Oid peoid;
1325
1327 vinfo->kind = PGEKIND_VERTEX;
1328
1330
1331 rel = table_open(vinfo->relid, NoLock);
1332
1334 ereport(ERROR,
1336 errmsg("cannot add temporary element table to non-temporary property graph"),
1337 errdetail("Table \"%s\" is a temporary table.", get_rel_name(vinfo->relid)),
1338 parser_errposition(pstate, vertex->vtable->location)));
1339
1340 if (vertex->vtable->alias)
1341 vinfo->aliasname = vertex->vtable->alias->aliasname;
1342 else
1343 vinfo->aliasname = vertex->vtable->relname;
1344
1345 vinfo->key = propgraph_element_get_key(pstate, vertex->vkey, rel, vinfo->aliasname, vertex->location);
1346
1347 vinfo->labels = vertex->labels;
1348
1349 table_close(rel, NoLock);
1350
1353 CStringGetDatum(vinfo->aliasname)))
1354 ereport(ERROR,
1356 errmsg("alias \"%s\" already exists in property graph \"%s\"",
1357 vinfo->aliasname, stmt->pgname->relname),
1358 parser_errposition(pstate, vertex->vtable->location));
1359
1361
1365 }
1366
1367 foreach(lc, stmt->add_edge_tables)
1368 {
1370 struct element_info *einfo;
1371 Relation rel;
1374 Oid peoid;
1375
1377 einfo->kind = PGEKIND_EDGE;
1378
1380
1381 rel = table_open(einfo->relid, NoLock);
1382
1384 ereport(ERROR,
1386 errmsg("cannot add temporary element table to non-temporary property graph"),
1387 errdetail("Table \"%s\" is a temporary table.", get_rel_name(einfo->relid)),
1388 parser_errposition(pstate, edge->etable->location)));
1389
1390 if (edge->etable->alias)
1391 einfo->aliasname = edge->etable->alias->aliasname;
1392 else
1393 einfo->aliasname = edge->etable->relname;
1394
1395 einfo->key = propgraph_element_get_key(pstate, edge->ekey, rel, einfo->aliasname, edge->location);
1396
1397 einfo->srcvertexid = get_vertex_oid(pstate, pgrelid, edge->esrcvertex, edge->location);
1398 einfo->destvertexid = get_vertex_oid(pstate, pgrelid, edge->edestvertex, edge->location);
1399
1400 einfo->srcrelid = get_element_relid(einfo->srcvertexid);
1401 einfo->destrelid = get_element_relid(einfo->destvertexid);
1402
1403 srcrel = table_open(einfo->srcrelid, AccessShareLock);
1404 destrel = table_open(einfo->destrelid, AccessShareLock);
1405
1406 propgraph_edge_get_ref_keys(pstate, edge->esrckey, edge->esrcvertexcols, rel, srcrel,
1407 einfo->aliasname, edge->location, "SOURCE",
1408 &einfo->srckey, &einfo->srcref, &einfo->srceqop);
1409 propgraph_edge_get_ref_keys(pstate, edge->edestkey, edge->edestvertexcols, rel, destrel,
1410 einfo->aliasname, edge->location, "DESTINATION",
1411 &einfo->destkey, &einfo->destref, &einfo->desteqop);
1412
1413 einfo->labels = edge->labels;
1414
1417
1418 table_close(rel, NoLock);
1419
1422 CStringGetDatum(einfo->aliasname)))
1423 ereport(ERROR,
1425 errmsg("alias \"%s\" already exists in property graph \"%s\"",
1426 einfo->aliasname, stmt->pgname->relname),
1427 parser_errposition(pstate, edge->etable->location));
1428
1430
1434 }
1435
1436 foreach(lc, stmt->drop_vertex_tables)
1437 {
1438 char *alias = strVal(lfirst(lc));
1439 Oid peoid;
1440 ObjectAddress obj;
1441
1442 peoid = get_vertex_oid(pstate, pgrelid, alias, -1);
1444 performDeletion(&obj, stmt->drop_behavior, 0);
1445 }
1446
1447 foreach(lc, stmt->drop_edge_tables)
1448 {
1449 char *alias = strVal(lfirst(lc));
1450 Oid peoid;
1451 ObjectAddress obj;
1452
1453 peoid = get_edge_oid(pstate, pgrelid, alias, -1);
1455 performDeletion(&obj, stmt->drop_behavior, 0);
1456 }
1457
1458 /* Remove any orphaned pg_propgraph_label entries */
1459 if (stmt->drop_vertex_tables || stmt->drop_edge_tables)
1460 {
1462 {
1464 {
1465 ObjectAddress obj;
1466
1468 performDeletion(&obj, stmt->drop_behavior, 0);
1469 }
1470 }
1471 }
1472
1473 foreach(lc, stmt->add_labels)
1474 {
1476 Oid peoid;
1477 Oid pgerelid;
1479
1480 Assert(lp->label);
1481
1482 if (stmt->element_kind == PROPGRAPH_ELEMENT_KIND_VERTEX)
1483 peoid = get_vertex_oid(pstate, pgrelid, stmt->element_alias, -1);
1484 else
1485 peoid = get_edge_oid(pstate, pgrelid, stmt->element_alias, -1);
1486
1488
1491
1495 }
1496
1497 if (stmt->drop_label)
1498 {
1499 Oid peoid;
1500 Oid labeloid;
1502 ObjectAddress obj;
1506 int nlabels;
1507 HeapTuple tuple;
1508
1509 if (stmt->element_kind == PROPGRAPH_ELEMENT_KIND_VERTEX)
1510 peoid = get_vertex_oid(pstate, pgrelid, stmt->element_alias, -1);
1511 else
1512 peoid = get_edge_oid(pstate, pgrelid, stmt->element_alias, -1);
1513
1517 CStringGetDatum(stmt->drop_label));
1518 if (!labeloid)
1519 ereport(ERROR,
1521 errmsg("property graph \"%s\" element \"%s\" has no label \"%s\"",
1522 get_rel_name(pgrelid), stmt->element_alias, stmt->drop_label),
1523 parser_errposition(pstate, -1));
1524
1525 /*
1526 * Is the given label associated with the element? Is this the only
1527 * label associated with the element? Scan the
1528 * pg_propgraph_element_label table to find answers to these
1529 * questions. Stop scanning when we know both answers.
1530 */
1537 true, NULL, 1, ellabelkey);
1538 nlabels = 0;
1540 {
1542
1543 nlabels++;
1544
1545 if (ellabelform->pgellabelid == labeloid)
1546 ellabeloid = ellabelform->oid;
1547
1548 if (nlabels > 1 && ellabeloid)
1549 break;
1550 }
1553
1554 if (!ellabeloid)
1555 ereport(ERROR,
1557 errmsg("property graph \"%s\" element \"%s\" has no label \"%s\"",
1558 get_rel_name(pgrelid), stmt->element_alias, stmt->drop_label),
1559 parser_errposition(pstate, -1));
1560
1561 /*
1562 * Prevent dropping the last label from an element. Every element must
1563 * have at least one label associated with it.
1564 */
1565 if (nlabels == 1)
1566 ereport(ERROR,
1568 errmsg("cannot drop the last label from element \"%s\"",
1569 stmt->element_alias),
1570 errhint("Every element must have at least one label.")));
1571
1573 performDeletion(&obj, stmt->drop_behavior, 0);
1574
1575 /* Remove any orphaned pg_propgraph_label entries */
1577 {
1579 performDeletion(&obj, stmt->drop_behavior, 0);
1580 }
1581 }
1582
1583 if (stmt->add_properties)
1584 {
1585 Oid peoid;
1586 Oid pgerelid;
1587 Oid labeloid;
1589
1590 if (stmt->element_kind == PROPGRAPH_ELEMENT_KIND_VERTEX)
1591 peoid = get_vertex_oid(pstate, pgrelid, stmt->element_alias, -1);
1592 else
1593 peoid = get_edge_oid(pstate, pgrelid, stmt->element_alias, -1);
1594
1598 CStringGetDatum(stmt->alter_label));
1599 if (labeloid)
1604 if (!ellabeloid)
1605 ereport(ERROR,
1607 errmsg("property graph \"%s\" element \"%s\" has no label \"%s\"",
1608 get_rel_name(pgrelid), stmt->element_alias, stmt->alter_label),
1609 parser_errposition(pstate, -1));
1610
1612
1614
1618 }
1619
1620 if (stmt->drop_properties)
1621 {
1622 Oid peoid;
1623 Oid labeloid;
1625 ObjectAddress obj;
1626
1627 if (stmt->element_kind == PROPGRAPH_ELEMENT_KIND_VERTEX)
1628 peoid = get_vertex_oid(pstate, pgrelid, stmt->element_alias, -1);
1629 else
1630 peoid = get_edge_oid(pstate, pgrelid, stmt->element_alias, -1);
1631
1635 CStringGetDatum(stmt->alter_label));
1636 if (labeloid)
1641
1642 if (!ellabeloid)
1643 ereport(ERROR,
1645 errmsg("property graph \"%s\" element \"%s\" has no label \"%s\"",
1646 get_rel_name(pgrelid), stmt->element_alias, stmt->alter_label),
1647 parser_errposition(pstate, -1));
1648
1649 foreach(lc, stmt->drop_properties)
1650 {
1651 char *propname = strVal(lfirst(lc));
1652 Oid propoid;
1654
1659 if (propoid)
1664 if (!plpoid)
1665 ereport(ERROR,
1667 errmsg("property graph \"%s\" element \"%s\" label \"%s\" has no property \"%s\"",
1668 get_rel_name(pgrelid), stmt->element_alias, stmt->alter_label, propname),
1669 parser_errposition(pstate, -1));
1670
1672 performDeletion(&obj, stmt->drop_behavior, 0);
1673 }
1674
1676 }
1677
1678 /* Remove any orphaned pg_propgraph_property entries */
1679 if (stmt->drop_properties || stmt->drop_vertex_tables || stmt->drop_edge_tables || stmt->drop_label)
1680 {
1682 {
1683 Relation rel;
1684 SysScanDesc scan;
1685 ScanKeyData key[1];
1686
1688 ScanKeyInit(&key[0],
1692 /* XXX no suitable index */
1693 scan = systable_beginscan(rel, InvalidOid, true, NULL, 1, key);
1694 if (!systable_getnext(scan))
1695 {
1696 ObjectAddress obj;
1697
1699 performDeletion(&obj, stmt->drop_behavior, 0);
1700 }
1701
1702 systable_endscan(scan);
1704 }
1705 }
1706
1707 /*
1708 * Invalidate relcache entry of the property graph so that the queries in
1709 * the cached plans referencing the property graph will be rewritten
1710 * considering changes to the property graph.
1711 */
1713
1714 return pgaddress;
1715}
#define Assert(condition)
Definition c.h:1002
void performDeletion(const ObjectAddress *object, DropBehavior behavior, int flags)
Definition dependency.c:279
int errcode(int sqlerrcode)
Definition elog.c:875
int errhint(const char *fmt,...) pg_attribute_printf(1
int errdetail(const char *fmt,...) pg_attribute_printf(1
#define ERROR
Definition elog.h:40
#define NOTICE
Definition elog.h:36
#define ereport(elevel,...)
Definition elog.h:152
#define palloc0_object(type)
Definition fe_memutils.h:90
void systable_endscan(SysScanDesc sysscan)
Definition genam.c:604
HeapTuple systable_getnext(SysScanDesc sysscan)
Definition genam.c:515
SysScanDesc systable_beginscan(Relation heapRelation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key)
Definition genam.c:388
#define HeapTupleIsValid(tuple)
Definition htup.h:78
static void * GETSTRUCT(const HeapTupleData *tuple)
#define stmt
void CacheInvalidateRelcacheByRelid(Oid relid)
Definition inval.c:1688
#define NoLock
Definition lockdefs.h:34
#define ShareRowExclusiveLock
Definition lockdefs.h:41
#define AccessShareLock
Definition lockdefs.h:36
#define RowShareLock
Definition lockdefs.h:37
char * get_rel_name(Oid relid)
Definition lsyscache.c:2242
char get_rel_persistence(Oid relid)
Definition lsyscache.c:2392
Oid RangeVarGetRelidExtended(const RangeVar *relation, LOCKMODE lockmode, uint32 flags, RangeVarGetRelidCallback callback, void *callback_arg)
Definition namespace.c:442
@ RVR_MISSING_OK
Definition namespace.h:90
static char * errmsg
const ObjectAddress InvalidObjectAddress
#define ObjectAddressSet(addr, class_id, object_id)
int parser_errposition(ParseState *pstate, int location)
Definition parse_node.c:106
@ PROPGRAPH_ELEMENT_KIND_VERTEX
#define lfirst(lc)
Definition pg_list.h:172
#define lfirst_node(type, lc)
Definition pg_list.h:176
#define foreach_oid(var, lst)
Definition pg_list.h:503
END_CATALOG_STRUCT typedef FormData_pg_propgraph_element_label * Form_pg_propgraph_element_label
static Datum ObjectIdGetDatum(Oid X)
Definition postgres.h:252
static Datum CStringGetDatum(const char *X)
Definition postgres.h:383
#define InvalidOid
unsigned int Oid
static int fb(int x)
static void check_all_labels_properties(Oid pgrelid)
static Oid get_edge_oid(ParseState *pstate, Oid pgrelid, const char *alias, int location)
static Oid get_element_relid(Oid peid)
static Oid get_vertex_oid(ParseState *pstate, Oid pgrelid, const char *alias, int location)
static void insert_property_records(Oid graphid, Oid ellabeloid, Oid pgerelid, const PropGraphProperties *properties)
static Oid insert_label_record(Oid graphid, Oid peoid, const char *label)
static void check_element_label_properties(Oid ellabeloid)
static List * get_graph_label_ids(Oid graphid)
static Oid insert_element_record(ObjectAddress pgaddress, struct element_info *einfo)
static List * get_label_element_label_ids(Oid labelid)
static List * get_graph_property_ids(Oid graphid)
static void check_element_properties(Oid peoid)
static ArrayType * propgraph_element_get_key(ParseState *pstate, const List *key_clause, Relation element_rel, const char *aliasname, int location)
static void propgraph_edge_get_ref_keys(ParseState *pstate, const List *keycols, const List *refcols, Relation edge_rel, Relation ref_rel, const char *aliasname, int location, const char *type, ArrayType **outkey, ArrayType **outref, ArrayType **outeqop)
void ScanKeyInit(ScanKey entry, AttrNumber attributeNumber, StrategyNumber strategy, RegProcedure procedure, Datum argument)
Definition scankey.c:76
#define BTEqualStrategyNumber
Definition stratnum.h:31
Form_pg_class rd_rel
Definition rel.h:111
ArrayType * key
#define SearchSysCacheExists2(cacheId, key1, key2)
Definition syscache.h:102
#define GetSysCacheOid2(cacheId, oidcol, key1, key2)
Definition syscache.h:111
void table_close(Relation relation, LOCKMODE lockmode)
Definition table.c:126
Relation table_open(Oid relationId, LOCKMODE lockmode)
Definition table.c:40
void RangeVarCallbackOwnsRelation(const RangeVar *relation, Oid relId, Oid oldRelId, void *arg)
#define strVal(v)
Definition value.h:82
void CommandCounterIncrement(void)
Definition xact.c:1130

References AccessShareLock, Assert, BTEqualStrategyNumber, CacheInvalidateRelcacheByRelid(), check_all_labels_properties(), check_element_label_properties(), check_element_properties(), CommandCounterIncrement(), CStringGetDatum(), ereport, errcode(), errdetail(), errhint(), errmsg, ERROR, fb(), foreach_oid, Form_pg_propgraph_element_label, get_edge_oid(), get_element_relid(), get_graph_label_ids(), get_graph_property_ids(), get_label_element_label_ids(), get_rel_name(), get_rel_persistence(), get_vertex_oid(), GETSTRUCT(), GetSysCacheOid2, HeapTupleIsValid, insert_element_record(), insert_label_record(), insert_property_records(), InvalidObjectAddress, InvalidOid, element_info::key, lfirst, lfirst_node, NoLock, NOTICE, ObjectAddressSet, ObjectIdGetDatum(), palloc0_object, parser_errposition(), performDeletion(), propgraph_edge_get_ref_keys(), propgraph_element_get_key(), PROPGRAPH_ELEMENT_KIND_VERTEX, RangeVarCallbackOwnsRelation(), RangeVarGetRelidExtended(), RelationData::rd_rel, RowShareLock, RVR_MISSING_OK, ScanKeyInit(), SearchSysCacheExists2, ShareRowExclusiveLock, stmt, strVal, systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().

Referenced by ProcessUtilitySlow().

◆ CreatePropGraph()

ObjectAddress CreatePropGraph ( ParseState pstate,
const CreatePropGraphStmt stmt 
)
extern

Definition at line 104 of file propgraphcmds.c.

105{
108 ListCell *lc;
114
115 if (stmt->pgname->relpersistence == RELPERSISTENCE_UNLOGGED)
118 errmsg("property graphs cannot be unlogged because they do not have storage")));
119
121
122 foreach(lc, stmt->vertex_tables)
123 {
125 struct element_info *vinfo;
126 Relation rel;
127
129 vinfo->kind = PGEKIND_VERTEX;
130
132
133 rel = table_open(vinfo->relid, NoLock);
134
135 if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP)
137
138 if (vertex->vtable->alias)
139 vinfo->aliasname = vertex->vtable->alias->aliasname;
140 else
141 vinfo->aliasname = vertex->vtable->relname;
142
146 errmsg("alias \"%s\" used more than once as element table", vinfo->aliasname),
147 parser_errposition(pstate, vertex->location)));
148
149 vinfo->key = propgraph_element_get_key(pstate, vertex->vkey, rel, vinfo->aliasname, vertex->location);
150
151 vinfo->labels = vertex->labels;
152
153 table_close(rel, NoLock);
154
156
158 }
159
160 foreach(lc, stmt->edge_tables)
161 {
163 struct element_info *einfo;
164 Relation rel;
165 ListCell *lc2;
170
172 einfo->kind = PGEKIND_EDGE;
173
175
176 rel = table_open(einfo->relid, NoLock);
177
178 if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP)
180
181 if (edge->etable->alias)
182 einfo->aliasname = edge->etable->alias->aliasname;
183 else
184 einfo->aliasname = edge->etable->relname;
185
189 errmsg("alias \"%s\" used more than once as element table", einfo->aliasname),
190 parser_errposition(pstate, edge->location)));
191
192 einfo->key = propgraph_element_get_key(pstate, edge->ekey, rel, einfo->aliasname, edge->location);
193
194 einfo->srcvertex = edge->esrcvertex;
195 einfo->destvertex = edge->edestvertex;
196
197 srcrelid = 0;
198 destrelid = 0;
199 foreach(lc2, vertex_infos)
200 {
201 struct element_info *vinfo = lfirst(lc2);
202
203 if (strcmp(vinfo->aliasname, edge->esrcvertex) == 0)
204 srcrelid = vinfo->relid;
205
206 if (strcmp(vinfo->aliasname, edge->edestvertex) == 0)
207 destrelid = vinfo->relid;
208
209 if (srcrelid && destrelid)
210 break;
211 }
212 if (!srcrelid)
215 errmsg("source vertex \"%s\" of edge \"%s\" does not exist",
216 edge->esrcvertex, einfo->aliasname),
217 parser_errposition(pstate, edge->location)));
218 if (!destrelid)
221 errmsg("destination vertex \"%s\" of edge \"%s\" does not exist",
222 edge->edestvertex, einfo->aliasname),
223 parser_errposition(pstate, edge->location)));
224
227
228 propgraph_edge_get_ref_keys(pstate, edge->esrckey, edge->esrcvertexcols, rel, srcrel,
229 einfo->aliasname, edge->location, "SOURCE",
230 &einfo->srckey, &einfo->srcref, &einfo->srceqop);
231 propgraph_edge_get_ref_keys(pstate, edge->edestkey, edge->edestvertexcols, rel, destrel,
232 einfo->aliasname, edge->location, "DESTINATION",
233 &einfo->destkey, &einfo->destref, &einfo->desteqop);
234
235 einfo->labels = edge->labels;
236
239
240 table_close(rel, NoLock);
241
243
245 }
246
247 cstmt->relation = stmt->pgname;
248 cstmt->oncommit = ONCOMMIT_NOOP;
249
250 /*
251 * Automatically make it temporary if any component tables are temporary
252 * (see also DefineView()).
253 */
254 if (stmt->pgname->relpersistence == RELPERSISTENCE_PERMANENT
256 {
257 cstmt->relation = copyObject(cstmt->relation);
258 cstmt->relation->relpersistence = RELPERSISTENCE_TEMP;
260 (errmsg("property graph \"%s\" will be temporary",
261 stmt->pgname->relname)));
262 }
263
265
266 foreach(lc, vertex_infos)
267 {
268 struct element_info *vinfo = lfirst(lc);
269 Oid peoid;
270
273 }
274
275 foreach(lc, edge_infos)
276 {
277 struct element_info *einfo = lfirst(lc);
278 Oid peoid;
279 ListCell *lc2;
280
281 /*
282 * Look up the vertices again. Now the vertices have OIDs assigned,
283 * which we need.
284 */
285 foreach(lc2, vertex_infos)
286 {
287 struct element_info *vinfo = lfirst(lc2);
288
289 if (strcmp(vinfo->aliasname, einfo->srcvertex) == 0)
290 {
291 einfo->srcvertexid = vinfo->elementid;
292 einfo->srcrelid = vinfo->relid;
293 }
294 if (strcmp(vinfo->aliasname, einfo->destvertex) == 0)
295 {
296 einfo->destvertexid = vinfo->elementid;
297 einfo->destrelid = vinfo->relid;
298 }
299 if (einfo->srcvertexid && einfo->destvertexid)
300 break;
301 }
302 Assert(einfo->srcvertexid);
303 Assert(einfo->destvertexid);
304 Assert(einfo->srcrelid);
305 Assert(einfo->destrelid);
308 }
309
311
315
316 return pgaddress;
317}
List * lappend(List *list, void *datum)
Definition list.c:339
List * lappend_oid(List *list, Oid datum)
Definition list.c:375
bool list_member(const List *list, const void *datum)
Definition list.c:661
#define copyObject(obj)
Definition nodes.h:230
#define makeNode(_type_)
Definition nodes.h:159
#define NIL
Definition pg_list.h:68
@ ONCOMMIT_NOOP
Definition primnodes.h:59
Definition pg_list.h:54
ObjectAddress DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, ObjectAddress *typaddress, const char *queryString)
Definition tablecmds.c:818
String * makeString(char *str)
Definition value.c:63

References AccessShareLock, Assert, check_all_labels_properties(), check_element_properties(), CommandCounterIncrement(), copyObject, DefineRelation(), element_info::destrelid, ereport, errcode(), errmsg, ERROR, fb(), foreach_oid, insert_element_record(), InvalidOid, lappend(), lappend_oid(), lfirst, lfirst_node, list_member(), makeNode, makeString(), NIL, NoLock, NOTICE, ONCOMMIT_NOOP, palloc0_object, parser_errposition(), propgraph_edge_get_ref_keys(), propgraph_element_get_key(), RangeVarCallbackOwnsRelation(), RangeVarGetRelidExtended(), RelationData::rd_rel, element_info::srcrelid, stmt, table_close(), and table_open().

Referenced by ProcessUtilitySlow().