Re: Partial foreign keys, check constraints and inheritance

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Partial foreign keys, check constraints and inheritance
Дата
Msg-id 87hdaar5nt.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: Partial foreign keys, check constraints and inheritance  (Jaime Casanova <systemguards@gmail.com>)
Список pgsql-general
> On 11/17/05, Eric E <whalesuit@gmail.com> wrote:
> >
> > What's the best way to do this?  My immediate reaction is that I want a
> > partial foreign key, but perhaps this is not a good way to go about such
> > a design.

Normally I just have multiple columns with all but one NULL.

Alternatively you can make it a many-to-many relationship. So you have a
problem table and then you have a problem_product, problem_customer, and a
problem_order table.

--
greg

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Strange slow database
Следующее
От: Christopher Browne
Дата:
Сообщение: Re: Rebranding PostgreSQL