How to set up a table where 2 columns together must be unique?

Поиск
Список
Период
Сортировка
От Scott Chapman
Тема How to set up a table where 2 columns together must be unique?
Дата
Msg-id 200310312203.43866.scott_list@mischko.com
обсуждение исходный текст
Список pgsql-general
Hi all!

I want to create a table:

user_id: bigserial
user_name: text
user_company: text
password: text

How do I build this table so that user_name+user_company must be unique?
This way there can be only one of a given username for a given company name
but there can be more than one of a given username if they are with different
companies.

TIA,
Scott


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: 7.3.5 release (was: Re: SELECT with row>32k hangs over
Следующее
От: "Dann Corbit"
Дата:
Сообщение: Re: How to set up a table where 2 columns together must be unique?