Re: Foreign key constraint question

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Foreign key constraint question
Дата
Msg-id 20070720140617.GA85514@winnie.fuhr.org
обсуждение исходный текст
Ответ на Foreign key constraint question  (Perry Smith <pedz@easesoftware.com>)
Ответы Re: Foreign key constraint question  (Perry Smith <pedz@easesoftware.com>)
Список pgsql-general
On Fri, Jul 20, 2007 at 08:57:25AM -0500, Perry Smith wrote:
> I want to do something like this:
>
> ALTER TABLE companies ADD CONSTRAINT fk_companies_item_id
>              FOREIGN KEY (item_id, 'Company')
>              REFERENCES item_bases(item_id, item_type)
>              INITIALLY DEFERRED
>
> I could add a column to companies that is always set to "Company" but
> that seems like a waste.  I tried the above and I got a syntax error.

What purpose is the constraint intended to achieve?

--
Michael Fuhr

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

Предыдущее
От: Perry Smith
Дата:
Сообщение: Foreign key constraint question
Следующее
От: Perry Smith
Дата:
Сообщение: Re: Foreign key constraint question