Problem Deleting Referenced records

From: Alex <alex(at)meerkatsoft(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Problem Deleting Referenced records
Date: 2003-11-10 05:31:00
Message-ID: 3FAF2294.6060104@meerkatsoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
I have two tables , A and B where table B has a foreign key constraint
to table A.

I want to delete all records in table A that are older than a certain
date that are not referenced by table B.

When I use a DELETE FROM the entire transaction fails as soon as a
referential integrity violation is detected.

Is that the normal behavior? Is there a way to allow the deletion to
complete but skipping all those records that are referenced ?

Thanks in advance for any help.

Alex

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2003-11-10 05:44:45 Re: Problem Deleting Referenced records
Previous Message Rajesh Kumar Mallah 2003-11-10 04:38:28 Re: Problem in restoring data [SOLVED ]