Skip to content

ALTER SYSTEM SET CLUSTER

Set either the default cluster for users, or the system cluster for system-generated queries.

Setting the default cluster applies to all users who have not set their own default cluster. Any user can run this command.

Setting the system cluster applies to all system work, including automatic ANALYZE operations, flushing of rows from the row store, and "GC" operations. You must have sysadmin privileges to alter the system cluster.

ALTER SYSTEM SET { DEFAULT_CLUSTER name | SYSTEM_CLUSTER } name

Use double quotes for the cluster name if it contains special characters.

Examples

Set the default cluster:

yellowbrick=# alter system set default_cluster "bobr-rc6-cluster1";
ALTER SYSTEM SET DEFAULT_CLUSTER

Attempt to set the system cluster as a regular user, then try again as a user with sysadmin privileges:

premdb=> alter system set system_cluster "bobr-may3-small-cluster";
ERROR:  must be superuser or sysadmin to do SET SYSTEM_CLUSTER
premdb=> \c premdb ybsql_consumer
Password for user ybsql_consumer: 
You are now connected to database "premdb" as user "ybsql_consumer".
premdb=> alter system set system_cluster "bobr-may3-small-cluster";
ALTER SYSTEM SET SYSTEM_CLUSTER