Re: [CDBI] Fwd: find_or_create() barfs with constraints

[prev] [thread] [next] [Date index for 2005/08/03]

From: Aaron Turner
Subject: Re: [CDBI] Fwd: find_or_create() barfs with constraints
Date: 21:14 on 03 Aug 2005
Correct.  The issue is that this table had both a primary key (using  
a sequence (AUTO_INCREMENT in mysql speak) and *another* unique key  
which was supposed to contain two columns (but only contained one).   
The failure to insert problem had to do with the second unique key  
not being unique over a the single column.  See Ricardo's example of  
Kings of England earlier in this thread for what's going on.

        -- 
        Aaron Turner, Sr. Security Engineer                        
<aturner@xxxxxxxxxx.xxx>


On Aug 3, 2005, at 4:29 AM, Johnny Morano wrote:

> Isn't the primary key supposed always to be unique?
>
> quote: 'The primary key of a relational table uniquely identifies each
> record in the
> table.' (http://databases.about.com/cs/administration/g/ 
> primarykey.htm)
>
> So if you're using multiple columns for PK, the combination of those
> columns (values) must unique.
>
> Correct me if I'm wrong of course ;-)
>
> cya
>
> _______________________________________________
> ClassDBI mailing list
> ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
> http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
>
>


_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

(message missing)

Re: [CDBI] Fwd: find_or_create() barfs with constraints
Aaron Turner 21:14 on 03 Aug 2005

Generated at 09:40 on 09 Aug 2005 by mariachi v0.52