数据仓库服务 GAUSSDB(DWS)-ALTER FOREIGN TABLE (SQL on other GaussDB(DWS)):语法格式

时间:2024-01-26 16:15:21

语法格式

  • 设置外表属性:
    1
    2
    ALTER FOREIGN TABLE [ IF EXISTS ] tablename
        OPTIONS ( {[ SET ] option ['value']} [, ... ]);
    
  • 设置外表的所有者:
    1
    2
    ALTER FOREIGN TABLE [ IF EXISTS ] tablename 
        OWNER TO new_owner;
    
  • 更新外表列类型:
    1
    2
    ALTER FOREIGN TABLE [ IF EXISTS ] table_name
        MODIFY ( { column_name data_type [, ...] } );
    
  • 修改外表的列:
    1
    2
    ALTER FOREIGN TABLE [ IF EXISTS ] tablename 
        action [, ... ];
    
    其中action语法为:
    1
    2
    ALTER [ COLUMN ] column_name [ SET DATA ] TYPE data_type
        | MODIFY column_name data_type
    

    参考ALTER TABLE

support.huaweicloud.com/sqlreference-820-dws/dws_06_0125.html