On Sat, 2002-07-27 at 16:51, Stephen Haberman wrote:
> 
> Primary keys are usually defined as unique and not null. Autoincrement
> is something completely different than a primary key. defaultIdMethod
> can say how autoincrement is achieved, but I think only in fields where
> autoincrement is already specified.
> 

So if you have defined a table to use autoincrement and you do not
specify the primary key as being autoincremented, how do you expect it
to get a value?  It is redundant info.

It would be wrong to define a table as using any type of id generation
and then not expect that the pk is going to use that method.

Can you give me a realistic example?


> People familiar with databases know that primary keys and autoincrement
> are two separate things. 

They are separate things in that you can have a pk that is not
autoincremented, but it is wrong to define the table as using an id
generation method, if the pk does not use it.  Are you saying the
table's id method might be meant to be applied to some other column? 
That is not what I take it to mean.


>I think blurring the line and having some
> obscure rule that all primary key/int fields are autoincrement depending
> on what defaultIdMethod is set to will only confuse people. It has
> confused and still is confusing to me, at least.

There will only be one autoincremented column, when would you want two
autoincremented columns defined as a pk?  

> 
> You can make the argument that good database design dictates this or
> that, or that most everyone uses primary key/ints/autoincrements in this
> same way, but it still conflicts with a basic understanding of database
> principles.


How is having a pk made up of one column whose value is generated and
unique conflicting with a basic understanding of db principles?  I don't
think key generation is a general principle.  This whole discussion
makes me think you are wanting to have two columns that would be
autoincremented within a table and these would both be used as a pk.  I
have never encountered such a thing, why would someone design something
like that?  And why would torque want to promote a design like that?

john mcnally 




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to