Unix Technical Forum

BUG #2412: Foreing key accept nulls

This is a discussion on BUG #2412: Foreing key accept nulls within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 2412 Logged by: Sidar Lopez Cruz Email address: sidarlopez@hotmail.com PostgreSQL ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 09:58 AM
Sidar Lopez Cruz
 
Posts: n/a
Default BUG #2412: Foreing key accept nulls


The following bug has been logged online:

Bug reference: 2412
Logged by: Sidar Lopez Cruz
Email address: sidarlopez@hotmail.com
PostgreSQL version: 8.1.3
Operating system: Ubuntu 6.04
Description: Foreing key accept nulls
Details:

I think that when I create table that have a foreing key to another one
these FK may not accept nulls by default.

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 09:58 AM
Stephan Szabo
 
Posts: n/a
Default Re: BUG #2412: Foreing key accept nulls

On Fri, 28 Apr 2006, Sidar Lopez Cruz wrote:

>
> The following bug has been logged online:
>
> Bug reference: 2412
> Logged by: Sidar Lopez Cruz
> Email address: sidarlopez@hotmail.com
> PostgreSQL version: 8.1.3
> Operating system: Ubuntu 6.04
> Description: Foreing key accept nulls
> Details:
>
> I think that when I create table that have a foreing key to another one
> these FK may not accept nulls by default.


The SQL spec seems to say otherwise. A foreign key constraint with match
simple (unspecified) is considered satisfied if any component of the key
is null or there is a match in the referenced table. A foreign key
constraint with match full is considered satisified if all components of
the key is null or there is a match in the referenced table. For a
single column key, this means NULLs are acceptable unless the column has
other constraints (like not null).



---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:36 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com