Re: Foreign key constraint question

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Perry Smith <pedz(at)easesoftware(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Foreign key constraint question
Date: 2007-07-20 14:06:17
Message-ID: 20070720140617.GA85514@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Zlatko Matić 2007-07-20 14:27:18 Re: several postgres installations on the same machine?
Previous Message Perry Smith 2007-07-20 13:57:25 Foreign key constraint question