Altering location labels

ALTER_LOCATION_LABEL lets you change the label for a storage location in several ways:.

ALTER_LOCATION_LABEL lets you change the label for a storage location in several ways:

You can perform these operations on individual nodes or cluster-wide.

Adding a location label

You add a location label to an unlabled storage location with ALTER_LOCATION_LABEL. For example, unlabled storage location /home/dbadmin/Vertica/SSD is defined on a three-node cluster:

You can label this storage location as SSD on all nodes as follows:

=> SELECT ALTER_LOCATION_LABEL('/home/dbadmin/vertica/SSD', '', 'SSD');

Removing a location label

You can remove a location label only if both of these conditions are true:

  • The label is not specified in the storage policy of a database object.

  • The labeled location is not the last available storage for the objects associated with it.

The following statement removes the SSD label from the specified storage location on all nodes:

=> SELECT ALTER_LOCATION_LABEL('/home/dbadmin/SSD/tables','', '');
          ALTER_LOCATION_LABEL
------------------------------------------
 /home/dbadmin/SSD/tables label changed.
(1 row)

Effects of altering a location label

Altering a location label has the following effects:

Changing a label from... To... Has this effect:
No name New label You can specify the label in a storage policy.
Existing name New name You can specify the label in a storage policy. If the existing name is used in a storage policy, you cannot change the label.
Existing name No name You cannot use an unlabeled storage in a storage policy. If the existing name is used in a storage policy, you cannot remove the label.