Re: Foreign key constraint question

From: Lew <lew(at)lewscanon(dot)nospam>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Foreign key constraint question
Date: 2007-07-20 22:45:17
Message-ID: KrCdnfHJcIxgpzzbnZ2dnUVZ_jidnZ2d@comcast.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

Can there be more than one row in "item_bases" with the same "item_id" but
different "item_type"s?

--
Lew

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vincenzo Romano 2007-07-20 22:45:34 Difference between PRIMARY KEY index and UNIQUE-NOT NULL index
Previous Message Mitchell Vincent 2007-07-20 22:24:03 PGInstaller Project