Working with resource groups v15
Use these data definition language commands to create and manage resource groups.
Creating a resource group
Use the CREATE RESOURCE GROUP
command to create a new resource group.
Description
The CREATE RESOURCE GROUP
command creates a resource group with the specified name. You can then define resource limits on the group with the ALTER RESOURCE GROUP
command. The resource group is accessible from all databases in the EDB Postgres Advanced Server instance.
To use the CREATE RESOURCE GROUP
command, you must have superuser privileges.
Parameters
group_name
The name of the resource group.
Example
This example creates three resource groups named resgrp_a
, resgrp_b
, and resgrp_c
:
This query shows the entries for the resource groups in the edb_resource_group
catalog:
Modifying a resource group
Use the ALTER RESOURCE GROUP
command to change the attributes of an existing resource group. The command syntax comes in three forms.
This form renames the resource group:
This form assigns a resource type to the resource group:
This form resets the assignment of a resource type to its default in the group:
Description
The ALTER RESOURCE GROUP
command changes certain attributes of an existing resource group.
The form with the RENAME TO
clause assigns a new name to an existing resource group.
The form with the SET resource_type TO
clause assigns the specified literal value to a resource type. Or, when you specify DEFAULT
, it resets the resource type. Resetting a resource type means that the resource group has no defined limit on that resource type.
The form with the RESET resource_type
clause resets the resource type for the group.
To use the ALTER RESOURCE GROUP
command, you must have superuser privileges.
Parameters
group_name
The name of the resource group to alter.
new_name
The new name to assign to the resource group.
resource_type
Specifies the type of resource to which to set a usage value.
value | DEFAULT
When value
is specified, the literal value to assign to resource_type
. Specify DEFAULT
to reset the assignment of resource_type
for the resource group.
Example
These examples show the use of the ALTER RESOURCE GROUP
command:
This query shows the results of the ALTER RESOURCE GROUP
commands to the entries in the edb_resource_group
catalog:
Removing a resource group
Use the DROP RESOURCE GROUP
command to remove a resource group.