数据仓库服务 GaussDB(DWS)-ALTER FOREIGN TABLE (For HDFS or OBS):语法格式

时间:2025-01-26 10:51:16

语法格式

  • 设置外表属性:
    12
    ALTER FOREIGN TABLE [ IF EXISTS ]  table_name    OPTIONS ( {[ ADD | SET | DROP ] option ['value']} [, ... ]);
  • 设置外表的所有者:
    12
    ALTER FOREIGN TABLE [ IF EXISTS ] tablename     OWNER TO new_owner;
  • 更新外表列:
    12
    ALTER FOREIGN TABLE [ IF EXISTS ] table_name    MODIFY ( { column_name data_type | column_name [ CONSTRAINT constraint_name ] NOT NULL [ ENABLE ] | column_name [ CONSTRAINT constraint_name ] NULL } [, ...] );
  • 修改外表的列:
    12
    ALTER FOREIGN TABLE [ IF EXISTS ] tablename     action [, ... ];
    其中action语法为:
    1234567
    ALTER [ COLUMN ] column_name [ SET DATA ] TYPE data_type   | ALTER [ COLUMN ] column_name { SET | DROP } NOT NULL   | ALTER [ COLUMN ] column_name SET STATIS TICS  [PERCENT] integer   | ALTER [ COLUMN ] column_name OPTIONS ( {[ ADD | SET | DROP ] option ['value'] } [, ... ])   | MODIFY column_name data_type   | MODIFY column_name [ CONSTRAINT constraint_name ] NOT NULL [ ENABLE ]   | MODIFY column_name [ CONSTRAINT constraint_name ] NULL

    参考ALTER TABLE

support.huaweicloud.com/sqlreference-910-dws/dws_06_0124.html