Index: src/pager.c ================================================================== --- src/pager.c +++ src/pager.c @@ -4641,10 +4641,13 @@ } if( rc!=SQLITE_OK ){ sqlite3DbFree(0, zPathname); return rc; } + }else{ + /* a temporary or transient database */ + szPageDflt = SQLITE_DEFAULT_TEMP_PAGE_SIZE; } /* Allocate memory for the Pager structure, PCache object, the ** three file descriptors, the database file name and the journal ** file name. The layout in memory is as follows: Index: src/sqliteLimit.h ================================================================== --- src/sqliteLimit.h +++ src/sqliteLimit.h @@ -161,10 +161,17 @@ #endif #if SQLITE_DEFAULT_PAGE_SIZE>SQLITE_MAX_PAGE_SIZE # undef SQLITE_DEFAULT_PAGE_SIZE # define SQLITE_DEFAULT_PAGE_SIZE SQLITE_MAX_PAGE_SIZE #endif +#ifndef SQLITE_DEFAULT_TEMP_PAGE_SIZE +# define SQLITE_DEFAULT_TEMP_PAGE_SIZE 1024 +#endif +#if SQLITE_DEFAULT_TEMP_PAGE_SIZE>SQLITE_MAX_PAGE_SIZE +# undef SQLITE_DEFAULT_TEMP_PAGE_SIZE +# define SQLITE_DEFAULT_TEMP_PAGE_SIZE SQLITE_MAX_PAGE_SIZE +#endif /* ** Ordinarily, if no value is explicitly provided, SQLite creates databases ** with page size SQLITE_DEFAULT_PAGE_SIZE. However, based on certain ** device characteristics (sector-size and atomic write() support),