What am I missing here?
I have two tables:
CREATE TABLE source ( "sourceid" serial, "state" character varying(255) REFERENCES states (state), "leadtime" character varying(255), CONSTRAINT source_pkey PRIMARY KEY (sourceid) ) CREATE INDEX ON source (state ASC NULLS LAST); CREATE TABLE updates ( "updateid" serial, "sourceid" integer REFERENCES source (sourceid) ON DELETE CASCADE, "skip" boolean, CONSTRAINT update_pkey PRIMARY KEY (updateid) ) CREATE INDEX ON updates (sourceid ASC NULLS LAST);
source is the parent table and updates the child. I want any records deleted from source to cascade down and delete all records in updates that have the same sourceid.
I have also tried adding the REFERENCES constraint to the sourceid field of the source table.