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

Function sepgsql_relation_setattr_extra

contrib/sepgsql/relation.c:720–751  ·  view source on GitHub ↗

* sepgsql_relation_setattr_extra * * It checks permission of the relation being referenced by extra attributes, * such as pg_index entries. Like core PostgreSQL, sepgsql also does not deal * with such entries as individual "objects", thus, modification of these * entries shall be considered as setting an attribute of the underlying * relation. */

Source from the content-addressed store, hash-verified

718 * relation.
719 */
720static void
721sepgsql_relation_setattr_extra(Relation catalog,
722 Oid catindex_id,
723 Oid extra_oid,
724 AttrNumber anum_relation_id,
725 AttrNumber anum_extra_id)
726{
727 ScanKeyData skey;
728 SysScanDesc sscan;
729 HeapTuple tuple;
730 Datum datum;
731 bool isnull;
732
733 ScanKeyInit(&skey, anum_extra_id,
734 BTEqualStrategyNumber, F_OIDEQ,
735 ObjectIdGetDatum(extra_oid));
736
737 sscan = systable_beginscan(catalog, catindex_id, true,
738 SnapshotSelf, 1, &skey);
739 tuple = systable_getnext(sscan);
740 if (!HeapTupleIsValid(tuple))
741 elog(ERROR, "could not find tuple for object %u in catalog \"%s\"",
742 extra_oid, RelationGetRelationName(catalog));
743
744 datum = heap_getattr(tuple, anum_relation_id,
745 RelationGetDescr(catalog), &isnull);
746 Assert(!isnull);
747
748 sepgsql_relation_setattr(DatumGetObjectId(datum));
749
750 systable_endscan(sscan);
751}
752
753/*
754 * sepgsql_index_modify

Callers 1

sepgsql_index_modifyFunction · 0.85

Calls 8

ScanKeyInitFunction · 0.85
ObjectIdGetDatumFunction · 0.85
systable_beginscanFunction · 0.85
systable_getnextFunction · 0.85
heap_getattrFunction · 0.85
sepgsql_relation_setattrFunction · 0.85
DatumGetObjectIdFunction · 0.85
systable_endscanFunction · 0.85

Tested by

no test coverage detected