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: 20:29 on 03 Aug 2005
Hi Everyone,

I hate to admit this, but the problem was with me.  I'm still  
learning PostgreSQL (converting over from MySQL) and the my2pg.pl  
script removed one of the fields of my unique key which was the cause  
of the failure to insert.  Doh.

Thanks for all your help.

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


On Aug 3, 2005, at 8:25 AM, Johnny Morano wrote:

> Ah sorry!
>
> And thanks!
>
> And I always created a multi-column primary key (with an index on a
> autoincrement-column, usually called 'id') in the situation you
> explained. I see it can be done easier too... :-/
>
> cya!
>
> On Wed, 2005-08-03 at 11:16 -0400, Ricardo SIGNES wrote:
>
>> * Johnny Morano <jmorano@xxxxxxxx.xxx> [2005-08-03T06:14:40]
>>
>>> Isn't the primary key supposed always to be unique?
>>>
>>> [...]
>>>
>>> Correct me if I'm wrong of course ;-)
>>>
>>
>> You're right, but off-point.  The question was about unique keys that
>> aren't the primary key, not a primary key that isn't unique.
>>
>> I might have a Kings of England database with three columns:  
>> monarchid,
>> name, sequence.  monarchid is the primary id and must be unique, and
>> then I could further specify that (name, sequence) form a unique  
>> index,
>> apart from the primary key.  So, you can't have two Edward the  
>> Firsts.
>>
>> _______________________________________________
>> ClassDBI mailing list
>> ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
>> http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
>>
> -- 
>
> Johnny Morano | insaniac@xxxxxxxx.xxx | +32.473 894685
> [ perl rookie ] | [ linux geek ] | [ web kid ] | [ all ]
> '%*;s{}{ohn};s.$.n.;;%@;s|(.*?)$|$1y|;s%^%j%;%;;print;*%'
>
>
> _______________________________________________
> 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 20:29 on 03 Aug 2005

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