On Wed, Jan 25, 2012 at 11:39:27AM +0000, g...@novadsp.com scratched on the wall: > The console output below indicates that 'if not exists' clause is > unsupported for virtual tables. Is this a bug, oversight or by > design?
By design. The syntax diagrams make it clear that IF NOT EXISTS is not supported for CREATE VIRTUAL TABLE: http://www.sqlite.org/lang_createvtab.html Over the past 5+ years there have been several tickets open on this, but it has never been changed. That makes me think there is some more fundamental reason why IF NOT EXISTS is not supported. Not necessarily a code reason, but perhaps an interaction reason with FTS or one of the other standard v-tables. It should be noted that DROP TABLE IF EXISTS does work on virtual tables. In the case of external virtual tables (where the data is in an external source) it is possible to just preface a CREATE VIRTUAL TABLE with a DROP TABLE IF EXISTS. This doesn't work for R*Tree tables (which are internal virtual tables; their data is stored in shadow tables within the same database), but it will work for some types of virtual tables. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable." -- Angela Johnson _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users