2011/6/6 Igor Tandetnik <itandet...@mvps.org>:
>>> If you are talking about INTEGER PRIMARY KEY column, then no index is shown 
>>> for it because none is created. See also
>>> http://sqlite.org/lang_createtable.html#rowid
>>
>> That is what I am talking about. Something went wrong with my previous 
>> e-mail.
>>
>> The strange thing is that the INTEGER PRIMARY key is not shown when
>> using .indices without an argument, but is shown when I give a table.
>
> It shows nothing for me either way:
>
> sqlite> create table t(x integer primary key);
> sqlite> .indices
> sqlite> .indices t
> sqlite>
>
> Again - no index is created for an INTEGER PRIMARY KEY column, so none is 
> shown.

I was again wrong, but also right. It was not a PRIMARY index, but an
UNIQUE index:
sqlite> .schema weights
CREATE TABLE weights (
  id                     INTEGER        PRIMARY KEY,
  categoryID             INTEGER        NOT NULL,
  measureDate            DATE           DEFAULT (DATE('now')),
  weight                 FLOAT          NOT NULL,
  fat                    FLOAT,
  water                  FLOAT,
  muscle                 FLOAT,

  UNIQUE (
    categoryID,
    measureDate
  )
);
sqlite> .indices
sqlite> .indices weights
sqlite_autoindex_weights_1

-- 
Cecil Westerhof
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to