Re: foreign key constraints, cannot delete

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Josh Close <narshe(at)gmail(dot)com>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: foreign key constraints, cannot delete
Date: 2004-10-09 00:14:50
Message-ID: 20041009001450.GA61983@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Oct 08, 2004 at 04:21:01PM -0500, Josh Close wrote:
> On Fri, 8 Oct 2004 23:15:24 +0200, Martijn van Oosterhout
> <kleptog(at)svana(dot)org> wrote:
> > You havn't posted the exact error message. You'll have to if you want
> > people to properly explain what's going on...
>
> update or delete on "tblheadings" violates foreign key constraint "$1"
> on "tblheadings" DETAIL: Key (iid)=(22) is still referenced from table
> "tblheadings"

This looks like tblheadings has a foreign key reference to itself.
Is this the *exact* error message, cut-and-pasted? What do your
table definitions look like?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2004-10-09 00:32:56 Re: Rollback on Error
Previous Message Josh Close 2004-10-08 21:21:01 Re: foreign key constraints, cannot delete