[CDBI] Fwd: find_or_create() barfs with constraints
jmorano at moretrix.com
Wed Aug 3 16:25:32 BST 2005
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... :-/
On Wed, 2005-08-03 at 11:16 -0400, Ricardo SIGNES wrote:
> * Johnny Morano <jmorano at moretrix.com> [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 at lists.digitalcraftsmen.net
Johnny Morano | insaniac at moretrix.com | +32.473 894685
[ perl rookie ] | [ linux geek ] | [ web kid ] | [ all ]
More information about the ClassDBI