Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

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: Fri, 20 Jul 2007 08:06:17 -0600
  • Message-id: <20070720140617(dot)GA85514(at)winnie(dot)fuhr(dot)org>

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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group