On 16 Nov 2015, at 7:40pm, Igor Korot <ikorot01 at gmail.com> wrote:

> But if I issue this PRAGMA command the field name, field type and the PK
> are guaranteed to have some values, right?

No.  Create a field without a declared type and use that as your primary key.

> You can't create a field without a name

Correct.  At least I think so.

> or the type

Wrong.

178:~ simon$ sqlite3 ~/Desktop/fred.sql
SQLite version 3.8.10.2 2015-05-20 18:17:19
Enter ".help" for usage hints.
sqlite> CREATE TABLE myTable (fred PRIMARY KEY);
sqlite> PRAGMA table_info(myTable);
0|fred||0||1
sqlite> PRAGMA index_list(myTable);
0|sqlite_autoindex_myTable_1|1|pk|0
sqlite> PRAGMA index_info(sqlite_autoindex_myTable_1);
0|0|fred
sqlite> PRAGMA index_xinfo(sqlite_autoindex_myTable_1);
0|0|fred|0|BINARY|1
1|-1||0|BINARY|0
sqlite> 

I'd like to emphasise something Scott Hess wrote.  There is considerable leeway 
in the documentation for PRAGMAs and things can change from one version of 
SQLite to another.  Pragmas like this are for use only when you don't know the 
answers.  For example for database management software which has to operate on 
any SQLite database.

Simon.

Reply via email to