Tengo 4 tablas diferentes y quiero eliminar una fila, pero dice: todavía se hace referencia a la identificación de la tabla "partes". ¿Cómo eliminar de la tabla un automóvil específico (por ejemplo, con id = 10) y eliminar todos los datos sin eliminar todas las tablas y datos? Creé tablas con Delete Restrict.
Table Car: variables Table Repair: variables, car_id integer NOT NULL REFERENCES car(id) ON UPDATE CASCADE ON DELETE RESTRICT Table Parts: variables, repair_id integer NOT NULL REFERENCES repair(id) ON UPDATE CASCADE ON DELETE RESTRICT Table Shop: variables, part_id integer NOT NULL REFERENCES part(id) ON UPDATE CASCADE ON DELETE RESTRICTse configura ON DELETE RESTRICT , por lo que restringe la eliminación si todavía se hace referencia. En la transacción, debe drop existing FK y agregar uno nuevo con REFERENCES car(id) ON UPDATE CASCADE ON DELETE CASCADE , luego podrá eliminar en cascada ...