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

时间:2024-01-23 20:09:27

语法格式

  • 修改类型
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    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 ]
    
  • 给复合类型增加新的属性。
    1
    ALTER TYPE name ADD ATTRIBUTE attribute_name data_type [ COLLATE collation ] [ CASCADE | RESTRICT ]
    
support.huaweicloud.com/devg-v1-gaussdb/gaussdb_devg_0514.html