Re: Constraint Question - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: Constraint Question
Date
Msg-id 20060317080159.GA25138@wolff.to
Whole thread Raw
In response to Constraint Question  (Kai Hessing <kai.hessing@hobsons.de>)
Responses Re: Constraint Question  (Kai Hessing <kai.hessing@hobsons.de>)
List pgsql-general
On Thu, Mar 16, 2006 at 18:11:33 +0100,
  Kai Hessing <kai.hessing@hobsons.de> wrote:
>
> The 'status'-row can contain either 1 or -1 and -4. And now I would like
> to implement the action that if the the status field in the master table
> for a special sid is changed, all status-fields in phon for entries
> which referencing this sid are also changed.
>
> Can this be done somehow with a foreign key? If it can, how?

This seems kind of odd. If the values are supposed to be the same, why are
you including them in multiple tables? If there aren't supposed to always
be the same, you won't be able to use foreign keys to sometimes make them
the same.

pgsql-general by date:

Previous
From: Etienne Labuschagne
Date:
Subject: Slow trigger on identical DB but different machine
Next
From: Leonardo Francalanci
Date:
Subject: Re: Replication & web apps