我正在使用具有 Oracle 兼容性的 Enterprise Postgres。这是我在数据库中创建的表。
CREATE TABLE ALL_COUNTRIES
(
COUNTRY_ID numeric(20,0),
CHARACTERISTIC_NAME character varying(255)
)
PARTITION BY LIST (COUNTRY_ID)
(
PARTITION COUNTRY VALUES (484, 170, 76, 360, 710) TABLESPACE my_tbs
);
创建了两个表。一个是主表,另一个是分区表。
主表:
CREATE TABLE cdar_panel.all_countries
(
country_id numeric(20,0),
characteristic_name character varying(255)
)
分区表:
CREATE TABLE cdar_panel.all_countries_country
(
country_id ,
characteristic_name ,
CONSTRAINT all_countries_country_partition CHECK ((country_id = ANY (ARRAY['484'::numeric(20,0), '170'::numeric(20,0), '76'::numeric(20,0), '360'::numeric(20,0), '710'::numeric(20,0)])) AND country_id IS NOT NULL)
)
INHERITS (cdar_panel.all_countries)
我要做的就是在该 CHECK 约束中再添加两个字段。我可以知道该怎么做吗?
它不允许我 1. 改变约束。2.不能删除“唯一分区”。3. 不能再增加一个约束,删除原来的。
请帮忙。