Ok thanks for the explanation.

Maybe I am being dense here (not uncommon ;) but what is the
difference between...

add_primary_key [:user_id, :store, :object, :fn]

and

index [:user_id,  :store, :object, :fn], :unique => true

Both seem to create a multi key unique index, what is the extra
constraint that is added with primary_key?
or is it different for Mysql and postgresql?

Thanks

On Dec 6, 2:26 pm, John W Higgins <[email protected]> wrote:
> On Mon, Dec 6, 2010 at 1:37 PM, Jim Morris <[email protected]> wrote:
> > Hi,
>
> > WRT this bug entry
> >http://code.google.com/p/ruby-sequel/issues/detail?id=317
>
> > I thought a primary key with multiple columns is more like an index
> > not a constraint.
>
> Primary Keys are always a constraint. They fall within the family of Unique
> Keys.
>
> However, most implementations will setup both the constraint and an index
> because clearly one is normally interested in both. This doesn't change the
> role of a primary key - it's just a nice add on that most engines help with.
>
> John

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to