On 6/27/07, Andrew Finkenstadt <[EMAIL PROTECTED]> wrote:

On 6/27/07, Neil Hughes <[EMAIL PROTECTED]> wrote:
>
> PRAGMA default_cache_size=250000;
> PRAGMA page_size=4096;
> CREATE TABLE timestamp (date TEXT, time TEXT, script_version REAL);
> INSERT INTO timestamp VALUES('27/06/07', '14:38:18', '0.01');
>

I've only just learned this today during an "innocent" refactoring.
page_size need be the first statement executed against a newly-created
database file.


On further review, pragma page_size=XX must be the first statement executed
against a newly-created database file, which statements cause the pager to
allocate the initial database page.  So default_cache_size is stored in the
database file, and therefore executing that statement on a virgin database
file causes its creation, which sets the page_size to whatever the default
is for SQLite (1024 without modifications.)

--andy

Reply via email to