The documentation for PRAGMA table_info says: The 'pk' column in the result
set is zero for columns that are not part of the primary key, and is the
index of the column in the primary key for columns that are part of the
primary key."  But in reality, pk = 1 for all the primary key columns:

    SQLite version 3.7.15.2 2013-01-09 11:53:05
    Enter ".help" for instructions
    Enter SQL statements terminated with a ";"
    sqlite> .mode column
    sqlite> .header on
    sqlite> CREATE TABLE foo (a INT, b INT, PRIMARY KEY(a,b));
    sqlite> PRAGMA table_info(foo);
    cid         name        type        notnull     dflt_value  pk
    ----------  ----------  ----------  ----------  ----------  ----------
    0           a           INT         0                       1
    1           b           INT         0                       1
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to