* Insert one capability to the capability table. * * @param rel the relation * @param groupid oid of the resource group * @param type the resource limit type * @param value the limit value */
| 1429 | * @param value the limit value |
| 1430 | */ |
| 1431 | static void |
| 1432 | insertResgroupCapabilityEntry(Relation rel, |
| 1433 | Oid groupid, |
| 1434 | uint16 type, |
| 1435 | const char *value) |
| 1436 | { |
| 1437 | Datum new_record[Natts_pg_resgroupcapability]; |
| 1438 | bool new_record_nulls[Natts_pg_resgroupcapability]; |
| 1439 | HeapTuple tuple; |
| 1440 | TupleDesc tupleDesc = RelationGetDescr(rel); |
| 1441 | |
| 1442 | MemSet(new_record, 0, sizeof(new_record)); |
| 1443 | MemSet(new_record_nulls, false, sizeof(new_record_nulls)); |
| 1444 | |
| 1445 | new_record[Anum_pg_resgroupcapability_resgroupid - 1] = ObjectIdGetDatum(groupid); |
| 1446 | new_record[Anum_pg_resgroupcapability_reslimittype - 1] = UInt16GetDatum(type); |
| 1447 | new_record[Anum_pg_resgroupcapability_value - 1] = CStringGetTextDatum(value); |
| 1448 | |
| 1449 | tuple = heap_form_tuple(tupleDesc, new_record, new_record_nulls); |
| 1450 | CatalogTupleInsert(rel, tuple); |
| 1451 | } |
| 1452 | |
| 1453 | /* |
| 1454 | * Delete capability entries of one resource group. |
no test coverage detected