Re: trigger to enforce FK with nulls?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: George Young <gry(at)ll(dot)mit(dot)edu>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: trigger to enforce FK with nulls?
Date: 2006-04-13 01:22:22
Message-ID: 20060413012221.GB14482@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

George Young wrote:

> Since foreign keys per se can't do this, I presume the way
> is to use triggers, though I have not used triggers before.

Says who? Just don't specify NOT NULL on the referencing column.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2006-04-13 01:26:18 Re: trigger to enforce FK with nulls?
Previous Message George Young 2006-04-13 01:11:18 trigger to enforce FK with nulls?