Re: enforcing with unique indexes..

Поиск
Список
Период
Сортировка
От
Тема Re: enforcing with unique indexes..
Дата
Msg-id 49201.192.168.1.32.1033827192.squirrel@mainbox.archonet.com
обсуждение исходный текст
Ответ на enforcing with unique indexes..  ("Rajesh Kumar Mallah." <mallah@trade-india.com>)
Список 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




В списке pgsql-sql по дате отправления: