云数据库 GAUSSDB-ALTER TYPE:语法格式

时间:2024-11-02 18:53:02

语法格式

  • 修改类型。
    ALTER TYPE name action [, ... ]
    ALTER TYPE name OWNER TO { new_owner | CURRENT_USER | SESSION_USER }
    ALTER TYPE name RENAME ATTRIBUTE attribute_name TO new_attribute_name [ CASCADE | RESTRICT ]
    ALTER TYPE name RENAME TO new_name
    ALTER TYPE name SET SCHEMA new_schema
    ALTER TYPE name ADD VALUE [ IF NOT EXISTS ] new_enum_value [ { BEFORE | AFTER } neighbor_enum_value ] 
    ALTER TYPE name RENAME VALUE existing_enum_value TO new_enum_value
    
    where action is one of:
        ADD ATTRIBUTE attribute_name data_type [ COLLATE collation ] [ CASCADE | RESTRICT ]
        DROP ATTRIBUTE [ IF EXISTS ] attribute_name [ CASCADE | RESTRICT ]
        ALTER ATTRIBUTE attribute_name [ SET DATA ] TYPE data_type [ COLLATE collation ] [ CASCADE | RESTRICT ]
  • 给复合类型增加新的属性。
    ALTER TYPE name ADD ATTRIBUTE attribute_name data_type [ COLLATE collation ] [ CASCADE | RESTRICT ]
support.huaweicloud.com/centralized-devg-v2-gaussdb/devg_03_0527.html