SQLite Forum

max page count doesn't return sqlite_full error when reaches the limit of page count
Login
Are you opening an existing file? Page size can only be run either before the file has actually been written, or right before a vacuum to change the page size. If you've opened an existing file, pragma page_size on its own won't do anything unless immediately followed by vacuum.

From the pragma documentation: "The maximum page count cannot be reduced below the current database size." What are you getting when you do your max_page_count pragma?

What following commands are you trying which are succeeding?


SQLite version 3.31.1 2020-01-27 19:55:54
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> pragma page_size = 512;
sqlite> pragma max_page_count = 1;
1
sqlite> create table foo (a text);
Error: database or disk is full
sqlite>