Re: foreign keys?

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Jeremy Hansen <jeremy(at)xxedgexx(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: foreign keys?
Date: 2001-07-21 21:46:45
Message-ID: Pine.BSF.4.21.0107211446160.48331-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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?

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joshua Jore 2001-07-21 21:47:09 Re: Microsoft SQL Server Replication
Previous Message Mitch Vincent 2001-07-21 20:38:10 Re: How Postgresql Compares For Query And Load Operations