I have a problem with my delete statement.
I have two tables:
table vehicule_loan( vehicule TEXT NOT NULL UNIQUE, ); table vehicule_uid ( id UUID NOT NULL DEFAULT uuid_generate_v4(), vehicule TEXT NOT NULL REFERENCES vehicule_loan(vehicule) ON DELETE NO ACTION );
When I delete the vehicule from the vehicule_loan table, I want the row links in the vehicule_uid table to vehicule_uid kept.
But when I try to delete one, I get this error:
ERROR: update or delete on table "vehicule_loan" violates foreign key constraint "vehicule_uid_vehicule_fkey" on table "vehicule_uid"
I think I understand the error: After I delete the vehicule from the vehicule_loan table, the vehicule in vehicule_uid will not show anything.
But is there a way to save the lines in vehicule_uid ?
source share