SQLite Forum

Request: Allow VACUUM INTO with a new page size even in WAL mode
Login
The page size being fixed while in WAL mode is a perfectly reasonable limitation. However, I don't see how those reasons apply to <code>VACUUM INTO</code>, which creates a new database without changing the original one.

The patch below seems to do what I want without breaking anything else.

```

Index: src/vacuum.c
==================================================================
--- src/vacuum.c
+++ src/vacuum.c
@@ -247,12 +247,14 @@
   if( rc!=SQLITE_OK ) goto end_of_vacuum;
   rc = sqlite3BtreeBeginTrans(pMain, pOut==0 ? 2 : 0, 0);
   if( rc!=SQLITE_OK ) goto end_of_vacuum;
 
   /* Do not attempt to change the page size for a WAL database */
-  if( sqlite3PagerGetJournalMode(sqlite3BtreePager(pMain))
-                                               ==PAGER_JOURNALMODE_WAL ){
+  if( !pOut
+      && sqlite3PagerGetJournalMode(sqlite3BtreePager(pMain))
+                                               ==PAGER_JOURNALMODE_WAL
+  ){
     db->nextPagesize = 0;
   }
 
   if( sqlite3BtreeSetPageSize(pTemp, sqlite3BtreeGetPageSize(pMain), nRes, 0)
    || (!isMemDb && sqlite3BtreeSetPageSize(pTemp, db->nextPagesize, nRes, 0))


```