* 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. */
| 718 | * relation. |
| 719 | */ |
| 720 | static void |
| 721 | sepgsql_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 |
no test coverage detected