Re: enforcing with unique indexes..

From: <dev(at)archonet(dot)com>
To: <mallah(at)trade-india(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: enforcing with unique indexes..
Date: 2002-10-05 14:13:12
Message-ID: 49201.192.168.1.32.1033827192.squirrel@mainbox.archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

>
> ie i want 1 to 1 mapping between group_id and userid so that , there
> shud not be a single group_id having more that one kind of userid.
>
> can it be done with some sort of UNIQUE INDEX?

If you want multiple groups but the user should always be the same

1 1 ok
1 1 ok
2 1 ok
3 2 ok
3 3 bad

Perhaps you should normalise a bit further with a separate group_user
table - you could restrict that to being unique on group then.

- Richard Huxton

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message pete 2002-10-05 22:19:31 problem with subqueries
Previous Message Rajesh Kumar Mallah. 2002-10-05 07:18:10 Re: enforcing with unique indexes..