Foreign key constraint question

Поиск
Список
Период
Сортировка
От Perry Smith
Тема Foreign key constraint question
Дата
Msg-id 107462CF-559E-4923-A5EC-40408B7B8737@easesoftware.com
обсуждение исходный текст
Ответы Re: Foreign key constraint question  (Michael Fuhr <mike@fuhr.org>)
Re: Foreign key constraint question  ("Sergey Konoplev" <gray.ru@gmail.com>)
Список pgsql-general
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.

Any suggestions?

Thank you,
Perry Smith ( pedz@easesoftware.com )
Ease Software, Inc. ( http://www.easesoftware.com )

Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems


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

Предыдущее
От: Kenneth Downs
Дата:
Сообщение: Re: Retrieve the record ID
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: Foreign key constraint question