The docs[1] say that:

> The page_size pragma will only set in the page size if it is issued before 
> any other SQL statements that cause I/O against the database file.

It's not stated explicitly, but I believe the pragma has to be issued before 
any other statement _ever_ causes I/O, i.e. it has to be the very first 
persistent statement ever used on a new database file. (Except for the 
situation regarding VACUUM described later on.) Is this true?

(Also, the word "in" is a typo that should be removed from that sentence.)

> SQL statements that cause I/O against the database file include "CREATE", 
> "SELECT", "BEGIN IMMEDIATE", and "PRAGMA journal_mode=WAL".

I'm guessing that "PRAGMA user_version" also causes I/O. The implication is 
that, if you want to set the page_size, you have to do it every time the 
database is opened, not just on first-time initialization; because checking to 
see if you've initialized the database already would trigger I/O which will 
make setting the page_size a no-op. (Unless you use the filesystem to check 
that the db file is missing or empty before opening it, I suppose.)

—Jens

[1]: http://www.sqlite.org/pragma.html#pragma_page_size
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to