Re: [sqlite] Composite primary key with autoincrement

2011-02-16 Thread Drake Wilson
Quoth Maciej Lotkowski , on 2011-02-16 09:45:45 +0100: > It's not about the real use case. I understand, that having such a > primary key probably doesn't make much sense. I'm asking if it is > technically possible to create a table like > > create table foo ( > id integer not null autoincremen

Re: [sqlite] Composite primary key with autoincrement

2011-02-16 Thread Maciej Lotkowski
On Wed, Feb 16, 2011 at 12:33 AM, Simon Slavin wrote: > Or to put it another way, if a column is autoincrement and you don't intend > to mess with the values manually, it's going to be unique anyway, so it makes > a good simple short primary key.  You may have good reasons to make another > ind

Re: [sqlite] Composite primary key with autoincrement

2011-02-15 Thread Simon Slavin
On 15 Feb 2011, at 11:28pm, Drake Wilson wrote: > Quoth Maciej Lotkowski , on 2011-02-15 23:28:01 > +0100: >> Is it possible to have composite primary key where one column is >> autoincrement? From what I found in docs it looks like it is possible >> to have either simple primary key on one auto

Re: [sqlite] Composite primary key with autoincrement

2011-02-15 Thread Drake Wilson
Quoth Maciej Lotkowski , on 2011-02-15 23:28:01 +0100: > Is it possible to have composite primary key where one column is > autoincrement? From what I found in docs it looks like it is possible > to have either simple primary key on one autoincrement column or > composite PK on few columns without

[sqlite] Composite primary key with autoincrement

2011-02-15 Thread Maciej Lotkowski
Hi Is it possible to have composite primary key where one column is autoincrement? From what I found in docs it looks like it is possible to have either simple primary key on one autoincrement column or composite PK on few columns without autoincrement. Am I right? If no, what is the syntax to cre

Re: [sqlite] Composite primary key?

2008-02-19 Thread drh
Rael Bauer <[EMAIL PROTECTED]> wrote: > Hi, > > > 1. with sqlite Is it possible to have a primary key made up of 2 fields? > (If so how...) > (from firebird: > ALTER TABLE "table1" ADD CONSTRAINT PK_TABLE1 PRIMARY KEY > ("field1","field2");) > > > 2. Is it possible to add a

[sqlite] Composite primary key?

2008-02-19 Thread Rael Bauer
Hi, 1. with sqlite Is it possible to have a primary key made up of 2 fields? (If so how...) (from firebird: ALTER TABLE "table1" ADD CONSTRAINT PK_TABLE1 PRIMARY KEY ("field1","field2");) 2. Is it possible to add a primary key with an "ALTER" statement like: ALTER TABLE