Sorry what is "very hard" about SELECT * FROM sqlite_master WHERE type = 'index' AND name = 'new_index_name'
to see if the index already exists Paul www.sandersonforensics.com skype: r3scue193 twitter: @sandersonforens Tel +44 (0)1326 572786 http://sandersonforensics.com/forum/content.php?195-SQLite-Forensic-Toolkit -Forensic Toolkit for SQLite email from a work address for a fully functional demo licence On 30 September 2016 at 14:33, Malte Legenhausen <mlegenhau...@gmail.com> wrote: > Hi, > > > > Could someone please explain why the following sequence of commands fail in > sqlite? > > > > SQLite version 3.14.0 > > > > sqlite> create table t1(one varchar(10)); > > sqlite> CREATE INDEX unique_one ON t1 (one); > > sqlite> create table t2(one varchar(10)); > > sqlite> CREATE INDEX unique_one ON t2 (one); > > Error: index unique_one already exists > > > > This is an unintended behaviour cause the following command returns with an > empty result: > > sqlite> PRAGMA INDEX_LIST(t2); > > > > Debugging this behaviour is very hard cause to make sure an index name is not > taken would result in looking in all indexes of all other existing tables. I > hope this is not an intended behaviour? Other database systems like postgres > can differ between indexes with the same name on different tables. > > > > If it is intended would it be possible to enhance the documentation? > > > > Best regards > > Malte > > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users