Hello,

On 2017-12-10 07:21, Igor Korot wrote:
The CREATE TABLE statement supports the following syntax:

CREATE TABLE( <column_name_list>, CONSTRAINT <fk_name> FOREIGN
KEY(<fk_field>) REFERENCES <ref_table>(ref_column_list>);

However, the statement "PRAGME foreign_key_list;" does not list the
foreign key name ("fk_name" in the statement above).

Does the info for the aforementioned PRAGMA stored somewhere?
If yes - does it include the key name and it just not printed with the PRAGMA?
If not - does this mean that the only way to get the name is to parse the sql
from sqlite_master? Or there is a better way?

The answer is ``not''. Constraint names are ignored and disappearing without a trace except for ``CHECK'' constraint (the name is used to build an error message). Unparsed ``sql'' column of ``sqlite_master'' is the sole place which contains an indirect info about ``FOREIGN KEY'' constraint's name.

-- best regards

Cezary H. Noweta
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to