我正在使用HAWQ 2.3.0版本。我想在两个表之间交换默认分区,但出现以下错误:
错误:无法交换表“ sales_stg”,因为它具有子表
使用的代码:-
Create table sales ( sales_id integer,LOADDATE timestamp with time zone DEFAULT now()) WITH (APPENDONLY=TRUE, OIDS=FALSE) distributed by(sales_id) Partition by RANGE(loaddate) (DEFAULT PARTITION others);
Create table sales_stg (sales_id integer,LOADDATE timestamp with time zone DEFAULT now()) WITH (APPENDONLY=TRUE, OIDS=FALSE) distributed by(sales_id) Partition by RANGE(loaddate) (DEFAULT PARTITION others);
Alter table sales exchange partition others with table sales_stg;