Re: "REFERENCES" and UNIQUE

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Michelle Konzack <linux4michelle(at)freenet(dot)de>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: "REFERENCES" and UNIQUE
Date: 2006-01-05 01:29:32
Message-ID: 20060104172902.O89722@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Wed, 4 Jan 2006, Stephan Szabo wrote:

> Which in this case hints that there's a problem with the schema.
>
> What is the final effect you're looking for? The above does let you

Err, that should be doesn't.

> lookup the DE or FR strings for a city of a member (what if two cities had
> the same EN name but different DE or FR names, how would you decide which
> one it was). If you only wanted to make sure that the city name was in a
> list, then it wouldn't matter if you made it unique.
>
> > Is there a solution for this problem?
>
> The easiest is to write triggers that check for a matching row on insert
> or update to members and make sure that you aren't removing the last match
> on update or deletion of cities. You need to be a little careful to get
> the locking right for concurrent actions on cities and members.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message elein 2006-01-05 02:15:01 Re: Question about how an application should store "system"
Previous Message Eric Busto 2006-01-05 00:43:01 unsubscribe