Search Postgresql Archives

Foreign key constraint question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx )
Ease Software, Inc. ( http://www.easesoftware.com )

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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux