Composite Keys

Поиск
Список
Период
Сортировка
От Bruce Elrick
Тема Composite Keys
Дата
Msg-id 382CC87B.E336E1DF@home.com
обсуждение исходный текст
Список pgsql-general
I couldn't grok this out of the docs.  Does PostGreSQL support composite
keys?  I am aware of the current lack of foreign key support except through
refint.so and triggers.

In my case, I'd like to have a single address table enforcing a unique
(employeenum, addrtype) instead of a home_address, office_address, and
worksite_address table, each enforcing a unique (employeenum) (which is a
foreign key of the employee table).  In reading up on the unique constraint,
it is not obvious (to someone who is not a DBA) whether the uniqueness is
enforced on the combination of fields or on the fields separately.

That is, (empnum, addrtype)'s of the form (A, x), (A, y), (B, x), (C, x), (C,
z) are ok, where you see neither empnum nor addrtype are unique, only the
composition is.

I'm probably stating the obvious but I am unsure...

Bruce
--
Bruce Elrick, Ph.D.                       Saltus Technology Consulting Group
Personal: belrick@home.com                          IBM Certified Specialist
Business: belrick@saltus.ab.ca          ADSM, AIX Support, RS/6000 SP, HACMP

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

Предыдущее
От: Marcin Inkielman
Дата:
Сообщение: Re: [GENERAL] Postgres concurrency : urgent
Следующее
От: Bruce Elrick
Дата:
Сообщение: Re: Composite Keys