1292{
1296
1303 {
1305 (
errmsg(
"relation \"%s\" does not exist, skipping",
1306 stmt->pgname->relname)));
1308 }
1309
1311
1312 foreach(
lc,
stmt->add_vertex_tables)
1313 {
1318
1321
1323
1325
1329 errmsg(
"cannot add temporary element table to non-temporary property graph"),
1332
1333 if (
vertex->vtable->alias)
1334 vinfo->aliasname =
vertex->vtable->alias->aliasname;
1335 else
1337
1339
1341
1343
1349 errmsg(
"alias \"%s\" already exists in property graph \"%s\"",
1350 vinfo->aliasname,
stmt->pgname->relname),
1352
1354
1358 }
1359
1360 foreach(
lc,
stmt->add_edge_tables)
1361 {
1368
1371
1373
1375
1379 errmsg(
"cannot add temporary element table to non-temporary property graph"),
1382
1383 if (
edge->etable->alias)
1384 einfo->aliasname =
edge->etable->alias->aliasname;
1385 else
1386 einfo->aliasname =
edge->etable->relname;
1387
1389
1392
1395
1398
1400 einfo->aliasname,
edge->location,
"SOURCE",
1403 einfo->aliasname,
edge->location,
"DESTINATION",
1405
1407
1410
1412
1418 errmsg(
"alias \"%s\" already exists in property graph \"%s\"",
1419 einfo->aliasname,
stmt->pgname->relname),
1421
1423
1427 }
1428
1429 foreach(
lc,
stmt->drop_vertex_tables)
1430 {
1434
1438 }
1439
1440 foreach(
lc,
stmt->drop_edge_tables)
1441 {
1445
1449 }
1450
1451
1452 if (
stmt->drop_vertex_tables ||
stmt->drop_edge_tables)
1453 {
1455 {
1457 {
1459
1462 }
1463 }
1464 }
1465
1466 foreach(
lc,
stmt->add_labels)
1467 {
1472
1474
1477 else
1479
1481
1484
1488 }
1489
1490 if (
stmt->drop_label)
1491 {
1496
1499 else
1501
1509 errmsg(
"property graph \"%s\" element \"%s\" has no label \"%s\"",
1512
1517
1521 errmsg(
"property graph \"%s\" element \"%s\" has no label \"%s\"",
1524
1527
1528
1530 {
1533 }
1534 }
1535
1536 if (
stmt->add_properties)
1537 {
1542
1545 else
1547
1555 errmsg(
"property graph \"%s\" element \"%s\" has no label \"%s\"",
1558
1566 errmsg(
"property graph \"%s\" element \"%s\" has no label \"%s\"",
1569
1571
1573
1577 }
1578
1579 if (
stmt->drop_properties)
1580 {
1585
1588 else
1590
1598 errmsg(
"property graph \"%s\" element \"%s\" has no label \"%s\"",
1601
1606
1610 errmsg(
"property graph \"%s\" element \"%s\" has no label \"%s\"",
1613
1614 foreach(
lc,
stmt->drop_properties)
1615 {
1619
1627 errmsg(
"property graph \"%s\" element \"%s\" label \"%s\" has no property \"%s\"",
1630
1632
1635 }
1636
1638 }
1639
1640
1641 if (
stmt->drop_properties ||
stmt->drop_vertex_tables ||
stmt->drop_edge_tables)
1642 {
1644 {
1648
1654
1657 {
1659
1662 }
1663
1666 }
1667 }
1668
1669
1670
1671
1672
1673
1675
1677}
#define Assert(condition)
void performDeletion(const ObjectAddress *object, DropBehavior behavior, int flags)
int errcode(int sqlerrcode)
int errdetail(const char *fmt,...) pg_attribute_printf(1
#define ereport(elevel,...)
#define palloc0_object(type)
void systable_endscan(SysScanDesc sysscan)
HeapTuple systable_getnext(SysScanDesc sysscan)
SysScanDesc systable_beginscan(Relation heapRelation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key)
void CacheInvalidateRelcacheByRelid(Oid relid)
#define ShareRowExclusiveLock
char * get_rel_name(Oid relid)
char get_rel_persistence(Oid relid)
Oid RangeVarGetRelidExtended(const RangeVar *relation, LOCKMODE lockmode, uint32 flags, RangeVarGetRelidCallback callback, void *callback_arg)
const ObjectAddress InvalidObjectAddress
#define ObjectAddressSet(addr, class_id, object_id)
int parser_errposition(ParseState *pstate, int location)
@ PROPGRAPH_ELEMENT_KIND_VERTEX
#define lfirst_node(type, lc)
#define foreach_oid(var, lst)
static Datum ObjectIdGetDatum(Oid X)
static Datum CStringGetDatum(const char *X)
static void check_all_labels_properties(Oid pgrelid)
static Oid get_edge_oid(ParseState *pstate, Oid pgrelid, const char *alias, int location)
static ArrayType * propgraph_element_get_key(ParseState *pstate, const List *keycols, Relation element_rel, const char *aliasname, 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 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)
#define BTEqualStrategyNumber
#define SearchSysCacheExists2(cacheId, key1, key2)
#define GetSysCacheOid2(cacheId, oidcol, key1, key2)
void table_close(Relation relation, LOCKMODE lockmode)
Relation table_open(Oid relationId, LOCKMODE lockmode)
void RangeVarCallbackOwnsRelation(const RangeVar *relation, Oid relId, Oid oldRelId, void *arg)
void CommandCounterIncrement(void)