On 6 September 2016 at 20:04, Clemens Ladisch <clem...@ladisch.de> wrote:

> Stephen Chrzanowski wrote:
> > [...] I'm relying on the results from "pragma
> > schema_version".  I've noticed that this bumps up every time I run a
> vacuum
> > or use the backup API against the database.  Is this supposed to happen?
>
> The documentation says that the schema version
> | is incremented by SQLite whenever the database schema is modified (by
> | creating or dropping a table or index). The schema version is used by
> | SQLite each time a query is executed to ensure that the internal cache
> | of the schema used when compiling the SQL query matches the schema of
> | the database against which the compiled query is actually executed.
>
> Inside a compiled statement, tables and indexes are identified by their
> root page number.  When running VACUUM, this is likely to change.
>

Interesting! Is there other non-schema modifying operations that bump the
version? What about ANALYZE? Obviously the first time it is run on a DB it
*does* modify the schema, but what about subsequent runs?

We recently made sqlite's logging more visible in our application and we're
seeing a lot more "schema has changed" warnings than I'd expect, since our
app pretty much doesn't touch the schema except during DB creation. I know
the warnings are harmless, just curious where they are coming from :)

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

Reply via email to