Re: foreign keys? - Mailing list pgsql-general

From Stephan Szabo
Subject Re: foreign keys?
Date
Msg-id Pine.BSF.4.21.0107211446160.48331-100000@megazone23.bigpanda.com
Whole thread Raw
In response to foreign keys?  (Jeremy Hansen <jeremy@xxedgexx.com>)
List pgsql-general
On Sat, 21 Jul 2001, Jeremy Hansen wrote:

>
> dta=> UPDATE test1 SET test_col=2;
> ERROR:  <unnamed> referential integrity violation - key in test1 still
> referenced from test2
>
> I'm following the example in the elephant book on foreign keys and I'm
> getting the above error on an update.  Has something changed on how
> foreign keys work?
>
> Thanks for any help.
>
> My goal is to have another table update itself from a change in the
> primary key of another table.  Foreign keys is what I should be using,
> right?

Is the foreign key defined with ON UPDATE CASCADE?



pgsql-general by date:

Previous
From: "Mitch Vincent"
Date:
Subject: Re: How Postgresql Compares For Query And Load Operations
Next
From: Tom Lane
Date:
Subject: Re: COPY failure