Foreign key constraint question

From: Perry Smith <pedz(at)easesoftware(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Foreign key constraint question
Date: 2007-07-20 13:57:25
Message-ID: 107462CF-559E-4923-A5EC-40408B7B8737@easesoftware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)easesoftware(dot)com )
Ease Software, Inc. ( http://www.easesoftware.com )

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2007-07-20 14:06:17 Re: Foreign key constraint question
Previous Message Kenneth Downs 2007-07-20 12:49:33 Re: Retrieve the record ID