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: Quick question re foreign keys.



D'Arcy J.M. Cain skrev:
> On Wed, 24 Oct 2007 11:00:47 +0800
> Paul Lambert <paul(dot)lambert(at)autoledgers(dot)com(dot)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




Home | Main Index | Thread Index

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