HomeMogDBMogDB StackUqbar
v3.1

Documentation:v3.1

Supported Versions:

Other Versions:

ALTER RESOURCE LABEL

Function

ALTER RESOURCE LABEL modifies resource labels.

Precautions

Only users with the poladmin or sysadmin permission, or the initial user can perform this operation.

Syntax

AlterResourceLabel ::= ALTER RESOURCE LABEL label_name { ADD | REMOVE }  label_item_list [, ...];
  • label_item_list

    label_item_list ::= resource_type ( resource_path[, ...] )
  • resource_type

    label_item_list ::= TABLE | COLUMN | SCHEMA | VIEW | FUNCTION

Parameter Description

  • label_name

    Specifies the resource label name.

    Value range: a string. It must comply with the naming convention.

  • resource_type

    Specifies the type of database resources to be labeled.

  • resource_path

    Specifies the path of database resources.

Examples

-- Create basic table table_for_label.
MogDB=# CREATE TABLE table_for_label(col1 int, col2 text);

-- Create resource label table_label.
MogDB=# CREATE RESOURCE LABEL table_label ADD COLUMN(table_for_label.col1);

-- Attach resource label table_label to col2.
MogDB=# ALTER RESOURCE LABEL table_label ADD COLUMN(table_for_label.col2)

-- Remove table_label from an item.
MogDB=# ALTER RESOURCE LABEL table_label REMOVE COLUMN(table_for_label.col1);

CREATE RESOURCE LABEL, DROP RESOURCE LABEL.

Copyright © 2011-2024 www.enmotech.com All rights reserved.