Non Identifying Foreign Key Relationships

From: "Karen Grose" <kgrose(at)vigilos(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Non Identifying Foreign Key Relationships
Date: 2003-03-25 00:19:11
Message-ID: 7391E3F2BADAEA43889BA0CEC76364A24BC6BC@vigilosnt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am in the process of upgrading to Postgresql 7.3.1 from 7.1. While testing the results of the conversion, I have run into an issue with establishing non-identifying or optional foreign key relationships.

1) My child table definition contains a foreign key that references the parent primary key
2) The child table column referencing the parent is not part of the child primary key
3) The child table column referencing the parent is defined with NULLS allowed

The test that I performed tried to load NULL values into the column and it failed with a referential integrity violation stating that the parent must exist. How do I accomplish creating this type of constraint within Postgresql version 7.3?

Thank you in advance for your help,
Karen Grose
kgrose(at)vigilos(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2003-03-25 00:36:22 Re: Non Identifying Foreign Key Relationships
Previous Message Cristian Custodio 2003-03-24 23:45:00 '' <> NULL