I am using Postgres 10 and Need to create the two table like below.
CREATE TABLE puplic.test1(
id character varying(8) NOT NULL,
name character varying(36) NOT NULL,
status character varying(36) NOT NULL,
CONSTRAINT pk_test1 PRIMARY KEY (id),
);
CREATE TABLE puplic.test2(
id character varying(8) NOT NULL,
name character varying(36) NOT NULL,
status character varying(36) NOT NULL,
CONSTRAINT pk_test2 PRIMARY KEY (id),
);
I want to move particular status records say "EXPIRED" from table test1 to test2.
And maintain the primary key unique data across the two table. Means my INSERT query should consider both the table primary key data before inserting data on to any one of the table.
Please help me to create tables structure with above requirements.