Bertrand,

This is from the doc on  the web

Specifying a PRIMARY KEY normally just creates a UNIQUE index on the primary key. 
However, if primary key is on a single column that has datatype INTEGER, then that 
column is used internally as the actual key of the B-Tree for the table. This means 
that the column may only hold unique integer values. (Except for this one case, SQLite 
ignores the datatype specification of columns and allows any kind of data to be put in 
a column regardless of its declared datatype.) If a table does not have an INTEGER 
PRIMARY KEY column, then the B-Tree key will be a automatically generated integer. The 
B-Tree key for a row can always be accessed using one of the special names "ROWID", 
"OID", or "_ROWID_". This is true regardless of whether or not there is an INTEGER 
PRIMARY KEY.

So adding the Primary Key does create an index.

you can verfiy this by doing 

create table a (b primary key,c);
select * from sqlite_master;


regards

Greg 

  ----- Original Message ----- 
  From: Bertrand Mansion 
  To: Kurt Welgehausen ; [EMAIL PROTECTED] 
  Sent: Monday, February 09, 2004 8:52 AM
  Subject: Re: [sqlite] Primary key and index


  <[EMAIL PROTECTED]> wrote :

  > Try
  > 
  >    select * from sqlite_master
  >    where tbl_name='yourTableName' and type='index'
  > 
  > This is all explained in the Create Table section of
  > lang.html and in the FAQ.

  Hi,

  Did you read my question ?
  I am afraid your answer is totally out of scope.

  Bertrand Mansion
  Mamasam


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

Reply via email to