On Thu, Nov 25, 2010 at 11:06 AM, Tito Ciuro <tci...@mac.com> wrote:

> On 25 Nov 2010, at 12:51, Igor Tandetnik <itandet...@mvps.org> wrote:
>
> > Run "PRAGMA integrity_check" right after opening.
>
> That could be a potentially slow operation if the database is valid and
> contains lots of records.
>
> Wouldn't be better to issue a SELECT statement and let SQLite come back
> with a SQLITE_NOTADB error right away?
>
>
I ran into this problem too.  What I did was to execute pragma
synchronous=full (or whatever mode you are using) after opening the
database.  This will fail if the file is not really an SQLite db or you have
the wrong key for an encrypted db.  It doesn't handle the problem of a
corrupted db, but as has been mentioned, there's not a fast way to detect
that.

Jim
--
HashBackup: easy onsite and offsite Unix backup
http://sites.google.com/site/hashbackup
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to