Re: [HACKERS] RI and NULL's

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: wieck(at)debis(dot)com (Jan Wieck)
Cc: pgsql-hackers(at)postgreSQL(dot)org (PostgreSQL HACKERS)
Subject: Re: [HACKERS] RI and NULL's
Date: 1999-09-23 23:29:51
Message-ID: 3.0.5.32.19990924092951.00b3a5d0@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 17:07 23/09/99 +0200, you wrote:
>
> Assuming NULL's are allowed in FK values (are they?)

I don't think they should be since two null fields are not equal, and the
reason for FK constraints to to require the foregn record exists. Also, I'm
pretty sure PK values should not be null.

> like to know what the correct handling of NULL values is. If
> an attribute of the FK has the NULL value, must a PK with a
> NULL in the corresponding attribute exist or is this
> attribute completely left out of the WHERE clause in the
> check?

I don't think so. I believe PK values can't be null, so no FK field should
be null.

> Other way round - NULL value in attribute of referenced
> table. What to delete from FK in the case of ON DELETE
> CASCADE?

This problem goes away.

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.C.N. 008 659 498) | /(@) ______---_
Tel: +61-03-5367 7422 | _________ \
Fax: +61-03-5367 7430 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sean Mullen 1999-09-23 23:40:43
Previous Message Lamar Owen 1999-09-23 22:39:06 Re: [PORTS] RedHat6.0 & Alpha