I'm using Enterprise Postgres with Oracle Compatibilty. Here is a table I have created in my database.
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
);
Two tables are created. One is main table and the other is partitioned table.
Main table:
CREATE TABLE cdar_panel.all_countries
(
country_id numeric(20,0),
characteristic_name character varying(255)
)
Partitioned table:
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)
All I want to do is add two more fields in that CHECK constraint. May I know how to do that.
It's not allowing me to 1. alter constraint. 2. Can't drop "only partition". 3. Can't add one more constraint and delete the original.
Please help.