postgresql修改主键的步骤

–删除主键
alter table dw_stg.stg_ord_fct_quote_items_info_mid drop CONSTRAINT stg_ord_fct_quote_items_info_mid_pkey;
–更改分布键
alter table dw_stg.stg_ord_fct_quote_items_info_mid set distributed by(quote_item_id,ord_loc);
–新增主键
alter table dw_stg.stg_ord_fct_quote_items_info_mid add CONSTRAINT stg_ord_fct_quote_items_info_mid_pkey primary key(quote_item_id,ord_loc);

你可能感兴趣的:(postgresql)