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 1291 of file propgraphcmds.c.

1292{
1293 Oid pgrelid;
1294 ListCell *lc;
1296
1297 /*
1298 * ShareRowExclusiveLock is required because this command runs some
1299 * graph-wide consistency checks that wouldn't work if more than one ALTER
1300 * PROPERTY GRAPH could operate on the same graph at once.
1301 */
1304 stmt->missing_ok ? RVR_MISSING_OK : 0,
1306 NULL);
1307 if (pgrelid == InvalidOid)
1308 {
1310 (errmsg("relation \"%s\" does not exist, skipping",
1311 stmt->pgname->relname)));
1312 return InvalidObjectAddress;
1313 }
1314
1316
1317 foreach(lc, stmt->add_vertex_tables)
1318 {
1320 struct element_info *vinfo;
1321 Relation rel;
1322 Oid peoid;
1323
1325 vinfo->kind = PGEKIND_VERTEX;
1326
1328
1329 rel = table_open(vinfo->relid, NoLock);
1330
1332 ereport(ERROR,
1334 errmsg("cannot add temporary element table to non-temporary property graph"),
1335 errdetail("Table \"%s\" is a temporary table.", get_rel_name(vinfo->relid)),
1336 parser_errposition(pstate, vertex->vtable->location)));
1337
1338 if (vertex->vtable->alias)
1339 vinfo->aliasname = vertex->vtable->alias->aliasname;
1340 else
1341 vinfo->aliasname = vertex->vtable->relname;
1342
1343 vinfo->key = propgraph_element_get_key(pstate, vertex->vkey, rel, vinfo->aliasname, vertex->location);
1344
1345 vinfo->labels = vertex->labels;
1346
1347 table_close(rel, NoLock);
1348
1351 CStringGetDatum(vinfo->aliasname)))
1352 ereport(ERROR,
1354 errmsg("alias \"%s\" already exists in property graph \"%s\"",
1355 vinfo->aliasname, stmt->pgname->relname),
1356 parser_errposition(pstate, vertex->vtable->location));
1357
1359
1363 }
1364
1365 foreach(lc, stmt->add_edge_tables)
1366 {
1368 struct element_info *einfo;
1369 Relation rel;
1372 Oid peoid;
1373
1375 einfo->kind = PGEKIND_EDGE;
1376
1378
1379 rel = table_open(einfo->relid, NoLock);
1380
1382 ereport(ERROR,
1384 errmsg("cannot add temporary element table to non-temporary property graph"),
1385 errdetail("Table \"%s\" is a temporary table.", get_rel_name(einfo->relid)),
1386 parser_errposition(pstate, edge->etable->location)));
1387
1388 if (edge->etable->alias)
1389 einfo->aliasname = edge->etable->alias->aliasname;
1390 else
1391 einfo->aliasname = edge->etable->relname;
1392
1393 einfo->key = propgraph_element_get_key(pstate, edge->ekey, rel, einfo->aliasname, edge->location);
1394
1395 einfo->srcvertexid = get_vertex_oid(pstate, pgrelid, edge->esrcvertex, edge->location);
1396 einfo->destvertexid = get_vertex_oid(pstate, pgrelid, edge->edestvertex, edge->location);
1397
1398 einfo->srcrelid = get_element_relid(einfo->srcvertexid);
1399 einfo->destrelid = get_element_relid(einfo->destvertexid);
1400
1401 srcrel = table_open(einfo->srcrelid, AccessShareLock);
1402 destrel = table_open(einfo->destrelid, AccessShareLock);
1403
1404 propgraph_edge_get_ref_keys(pstate, edge->esrckey, edge->esrcvertexcols, rel, srcrel,
1405 einfo->aliasname, edge->location, "SOURCE",
1406 &einfo->srckey, &einfo->srcref, &einfo->srceqop);
1407 propgraph_edge_get_ref_keys(pstate, edge->edestkey, edge->edestvertexcols, rel, destrel,
1408 einfo->aliasname, edge->location, "DESTINATION",
1409 &einfo->destkey, &einfo->destref, &einfo->desteqop);
1410
1411 einfo->labels = edge->labels;
1412
1415
1416 table_close(rel, NoLock);
1417
1420 CStringGetDatum(einfo->aliasname)))
1421 ereport(ERROR,
1423 errmsg("alias \"%s\" already exists in property graph \"%s\"",
1424 einfo->aliasname, stmt->pgname->relname),
1425 parser_errposition(pstate, edge->etable->location));
1426
1428
1432 }
1433
1434 foreach(lc, stmt->drop_vertex_tables)
1435 {
1436 char *alias = strVal(lfirst(lc));
1437 Oid peoid;
1438 ObjectAddress obj;
1439
1440 peoid = get_vertex_oid(pstate, pgrelid, alias, -1);
1442 performDeletion(&obj, stmt->drop_behavior, 0);
1443 }
1444
1445 foreach(lc, stmt->drop_edge_tables)
1446 {
1447 char *alias = strVal(lfirst(lc));
1448 Oid peoid;
1449 ObjectAddress obj;
1450
1451 peoid = get_edge_oid(pstate, pgrelid, alias, -1);
1453 performDeletion(&obj, stmt->drop_behavior, 0);
1454 }
1455
1456 /* Remove any orphaned pg_propgraph_label entries */
1457 if (stmt->drop_vertex_tables || stmt->drop_edge_tables)
1458 {
1460 {
1462 {
1463 ObjectAddress obj;
1464
1466 performDeletion(&obj, stmt->drop_behavior, 0);
1467 }
1468 }
1469 }
1470
1471 foreach(lc, stmt->add_labels)
1472 {
1474 Oid peoid;
1475 Oid pgerelid;
1477
1478 Assert(lp->label);
1479
1480 if (stmt->element_kind == PROPGRAPH_ELEMENT_KIND_VERTEX)
1481 peoid = get_vertex_oid(pstate, pgrelid, stmt->element_alias, -1);
1482 else
1483 peoid = get_edge_oid(pstate, pgrelid, stmt->element_alias, -1);
1484
1486
1489
1493 }
1494
1495 if (stmt->drop_label)
1496 {
1497 Oid peoid;
1498 Oid labeloid;
1500 ObjectAddress obj;
1504 int nlabels;
1505 HeapTuple tuple;
1506
1507 if (stmt->element_kind == PROPGRAPH_ELEMENT_KIND_VERTEX)
1508 peoid = get_vertex_oid(pstate, pgrelid, stmt->element_alias, -1);
1509 else
1510 peoid = get_edge_oid(pstate, pgrelid, stmt->element_alias, -1);
1511
1515 CStringGetDatum(stmt->drop_label));
1516 if (!labeloid)
1517 ereport(ERROR,
1519 errmsg("property graph \"%s\" element \"%s\" has no label \"%s\"",
1520 get_rel_name(pgrelid), stmt->element_alias, stmt->drop_label),
1521 parser_errposition(pstate, -1));
1522
1523 /*
1524 * Is the given label associated with the element? Is this the only
1525 * label associated with the element? Scan the
1526 * pg_propgraph_element_label table to find answers to these
1527 * questions. Stop scanning when we know both answers.
1528 */
1535 true, NULL, 1, ellabelkey);
1536 nlabels = 0;
1538 {
1540
1541 nlabels++;
1542
1543 if (ellabelform->pgellabelid == labeloid)
1544 ellabeloid = ellabelform->oid;
1545
1546 if (nlabels > 1 && ellabeloid)
1547 break;
1548 }
1551
1552 if (!ellabeloid)
1553 ereport(ERROR,
1555 errmsg("property graph \"%s\" element \"%s\" has no label \"%s\"",
1556 get_rel_name(pgrelid), stmt->element_alias, stmt->drop_label),
1557 parser_errposition(pstate, -1));
1558
1559 /*
1560 * Prevent dropping the last label from an element. Every element must
1561 * have at least one label associated with it.
1562 */
1563 if (nlabels == 1)
1564 ereport(ERROR,
1566 errmsg("cannot drop the last label from element \"%s\"",
1567 stmt->element_alias),
1568 errhint("Every element must have at least one label.")));
1569
1571 performDeletion(&obj, stmt->drop_behavior, 0);
1572
1573 /* Remove any orphaned pg_propgraph_label entries */
1575 {
1577 performDeletion(&obj, stmt->drop_behavior, 0);
1578 }
1579 }
1580
1581 if (stmt->add_properties)
1582 {
1583 Oid peoid;
1584 Oid pgerelid;
1585 Oid labeloid;
1587
1588 if (stmt->element_kind == PROPGRAPH_ELEMENT_KIND_VERTEX)
1589 peoid = get_vertex_oid(pstate, pgrelid, stmt->element_alias, -1);
1590 else
1591 peoid = get_edge_oid(pstate, pgrelid, stmt->element_alias, -1);
1592
1596 CStringGetDatum(stmt->alter_label));
1597 if (labeloid)
1602 if (!ellabeloid)
1603 ereport(ERROR,
1605 errmsg("property graph \"%s\" element \"%s\" has no label \"%s\"",
1606 get_rel_name(pgrelid), stmt->element_alias, stmt->alter_label),
1607 parser_errposition(pstate, -1));
1608
1610
1612
1616 }
1617
1618 if (stmt->drop_properties)
1619 {
1620 Oid peoid;
1621 Oid labeloid;
1623 ObjectAddress obj;
1624
1625 if (stmt->element_kind == PROPGRAPH_ELEMENT_KIND_VERTEX)
1626 peoid = get_vertex_oid(pstate, pgrelid, stmt->element_alias, -1);
1627 else
1628 peoid = get_edge_oid(pstate, pgrelid, stmt->element_alias, -1);
1629
1633 CStringGetDatum(stmt->alter_label));
1634 if (labeloid)
1639
1640 if (!ellabeloid)
1641 ereport(ERROR,
1643 errmsg("property graph \"%s\" element \"%s\" has no label \"%s\"",
1644 get_rel_name(pgrelid), stmt->element_alias, stmt->alter_label),
1645 parser_errposition(pstate, -1));
1646
1647 foreach(lc, stmt->drop_properties)
1648 {
1649 char *propname = strVal(lfirst(lc));
1650 Oid propoid;
1652
1657 if (propoid)
1662 if (!plpoid)
1663 ereport(ERROR,
1665 errmsg("property graph \"%s\" element \"%s\" label \"%s\" has no property \"%s\"",
1666 get_rel_name(pgrelid), stmt->element_alias, stmt->alter_label, propname),
1667 parser_errposition(pstate, -1));
1668
1670 performDeletion(&obj, stmt->drop_behavior, 0);
1671 }
1672
1674 }
1675
1676 /* Remove any orphaned pg_propgraph_property entries */
1677 if (stmt->drop_properties || stmt->drop_vertex_tables || stmt->drop_edge_tables || stmt->drop_label)
1678 {
1680 {
1681 Relation rel;
1682 SysScanDesc scan;
1683 ScanKeyData key[1];
1684
1686 ScanKeyInit(&key[0],
1690 /* XXX no suitable index */
1691 scan = systable_beginscan(rel, InvalidOid, true, NULL, 1, key);
1692 if (!systable_getnext(scan))
1693 {
1694 ObjectAddress obj;
1695
1697 performDeletion(&obj, stmt->drop_behavior, 0);
1698 }
1699
1700 systable_endscan(scan);
1702 }
1703 }
1704
1705 /*
1706 * Invalidate relcache entry of the property graph so that the queries in
1707 * the cached plans referencing the property graph will be rewritten
1708 * considering changes to the property graph.
1709 */
1711
1712 return pgaddress;
1713}
#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:817
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().