Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

85
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda