[email protected] wrote:
> I'm trying to create two queries so I can determine which of the keys
> for a given sqlite3 table is the primary key

SQLite does not give you this information.  PRAGMA index_list gives
you only indexes, but if the primary key is the ROWID, there is no
separate index to list.

> and which keys are foreign.

Please note that foreign keys are relationships between two tables.

Primary keys and foreign keys have the word "key" in their name, but
they have nothing in common.  There is no such thing as a list of keys
for a given table, so you don't need to differentiate them.

> the foreign_key_list pragma returns a result that that does not
> actually include the names of the foreign keys

There is no such thing as a key name.  Do you want to know the table
name (listed as "table"), the column names (listed as "from" and "to"),
or the constraint name (which often does not exist)?


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to