Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

75
Views
Delete data from 4 different tables

I've got 4 different tables and I want to delete one row, but it says: id is still referenced from table "parts". How to delete from table Car specific car (for example with id=10) and delete all data without dropping all tables and data? I created tables with 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 RESTRICT 
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

you set yourself ON DELETE RESTRICT , so it restricts deletion if still referenced. You have to in transaction drop existing FK add new with REFERENCES car(id) ON UPDATE CASCADE ON DELETE CASCADE then you will be able to delete cascaded...

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!