pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nis Jørgensen <nis@superlativ.dk>
To: pgsql-sql@postgresql.org
Cc: Paul Lambert <paul.lambert@autoledgers.com.au>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: Quick question re foreign keys.
Date: Wed, 24 Oct 2007 09:43:10 +0200
Message-ID: <471EF78E.8050503@superlativ.dk> (raw)
In-Reply-To: <20071024012705.5f253946.darcy@druid.net>
References: <471EA7D5.9040403@autoledgers.com.au>
	<21715.1193193880@sss.pgh.pa.us>
	<471EB55F.5050600@autoledgers.com.au>
	<20071024012705.5f253946.darcy@druid.net>

D'Arcy J.M. Cain skrev:
> On Wed, 24 Oct 2007 11:00:47 +0800
> Paul Lambert <paul.lambert@autoledgers.com.au> wrote:
>> It's marked not null as a result of being part of the primary key for 
>> that table which I can't really get around.
>>
>> I can get away with not having the foreign key though, so I'll have to 
>> go down that path.
> 
> It can't be the primary key and have NULLs.  It sounds to me like you
> have a design problem somewhere.

Well, I have a couple of times had the "need" to have a primary
key/uniqueness constraint with one column nullable (indicating "Not
Applicable"). The "problem" is that we have only one NULL, which for
comparison purposes is interpreted as "Not Known".

Nis




view thread (9+ messages)  latest in thread

Message-ID: <471EF78E.8050503@superlativ.dk>
Permalink:  ../471EF78E.8050503@superlativ.dk/
Also on:    postgresql.org/message-id/471EF78E.8050503@superlativ.dk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: nis@superlativ.dk, paul.lambert@autoledgers.com.au, tgl@sss.pgh.pa.us
  Subject: Re: Quick question re foreign keys.
  In-Reply-To: <471EF78E.8050503@superlativ.dk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox