云数据库 GaussDB-ALTER FOREIGN TABLE (导入导出):示例

时间:2023-11-01 16:22:50

示例

 1 2 3 4 5 6 7 8 910111213141516171819202122232425262728293031323334353637
--创建外部表。openGauss=# CREATE FOREIGN TABLE tpcds.customer_ft(    c_customer_sk             integer               ,    c_customer_id             char(16)              ,    c_current_cdemo_sk        integer               ,    c_current_hdemo_sk        integer               ,    c_current_addr_sk         integer               ,    c_first_shipto_date_sk    integer               ,    c_first_sales_date_sk     integer               ,    c_salutation              char(10)              ,    c_first_name              char(20)              ,    c_last_name               char(30)              ,    c_preferred_cust_flag     char(1)               ,    c_birth_day               integer               ,    c_birth_month             integer               ,    c_birth_year              integer                       ,    c_birth_country           varchar(20)                   ,    c_login                   char(13)                      ,    c_email_address           char(50)                      ,    c_last_review_date        char(10))    SERVER gsmpp_server    OPTIONS(    location 'gsfs://10.185.179.143:5000/customer1*.dat',    FORMAT 'TEXT' ,    DELIMITER '|',    encoding 'utf8',    mode 'Normal')READ ONLY;--修改外表属性,删除mode选项。openGauss=# ALTER FOREIGN TABLE tpcds.customer_ft options(drop mode);--删除外部表。openGauss=# DROP FOREIGN TABLE tpcds.customer_ft;
support.huaweicloud.com/distributed-devg-v2-opengauss/gaussdb-v5r2c10-0523.html