Re: [sqlite] Execute PRAGMA max_page_count command
"Raviv Shasha" <[EMAIL PROTECTED]> wrote: > Although I limit the sqlite database to 32768 (32K), the db file which > retrieved is equal to 470K. > > What regrading the operations sequence ? Is it correct to first > initialize the sqlite database and then to execute the PRAGMA > max_page_count command or not? > > What can cause this problem? > The max_page_count pragma limits the number of database "pages" not bytes. 32768 pages is 32MiB, assuming a 1KiB page (the default.) -- D. Richard Hipp <[EMAIL PROTECTED]> ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Execute PRAGMA max_page_count command
Although I limit the sqlite database to 32768 (32K), the db file which retrieved is equal to 470K. What regrading the operations sequence ? Is it correct to first initialize the sqlite database and then to execute the PRAGMA max_page_count command or not? What can cause this problem? -Raviv. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Igor Tandetnik Sent: Thursday, February 21, 2008 4:22 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Execute PRAGMA max_page_count command "Raviv Shasha" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The problem is although I got the zero value (->SQLITE_OK), the sqlite > database wasn't limited to 32768. How do you determine this? Be aware that max_page_count is not persistent, it's a per-connection option. Once set, queries executed over the same connection will make sure the database doesn't grow over the limit. But other connections, unless they also set the pragma, are not so restricted. Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Execute PRAGMA max_page_count command
"Raviv Shasha" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The problem is although I got the zero value (->SQLITE_OK), the sqlite > database wasn't limited to 32768. How do you determine this? Be aware that max_page_count is not persistent, it's a per-connection option. Once set, queries executed over the same connection will make sure the database doesn't grow over the limit. But other connections, unless they also set the pragma, are not so restricted. Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Execute PRAGMA max_page_count command
Thanks for your question, The problem is although I got the zero value (->SQLITE_OK), the sqlite database wasn't limited to 32768. Should I use the syntax : sqlSt = sqlite3_exec(pDB, "PRAGMA max_page_count=32768", NULL, 0,&errMsg); Thnaks, Raviv. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Igor Tandetnik Sent: Thursday, February 21, 2008 4:06 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Execute PRAGMA max_page_count command "Raviv Shasha" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > sqlSt = sqlite3_exec(pDB, "PRAGMA max_page_count=32768", NULL, 0, > &errMsg); > > The sqlite initialization succeeded, but the sqlSt value always > returned as zero. Zero is SQLITE_OK, meaning success. What seems to be the problem? -- With best wishes, Igor Tandetnik With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925 ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Execute PRAGMA max_page_count command
"Raviv Shasha" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > sqlSt = sqlite3_exec(pDB, "PRAGMA max_page_count=32768", NULL, 0, > &errMsg); > > The sqlite initialization succeeded, but the sqlSt value always > returned as zero. Zero is SQLITE_OK, meaning success. What seems to be the problem? -- With best wishes, Igor Tandetnik With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925 ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Execute PRAGMA max_page_count command
Hi all, I use the sqlite version 3.5.6 and tired to execute a PRAGMA max_page_count command to limit the sqlite database size and received always return value equals to zero. My code is shown as follows: // sqlite database initialization retVal = sqlite3_exec(pDB, sql, callback, ctxt, &errMsg); //limit the sqlite data base size to 32768 sqlSt = sqlite3_exec(pDB, "PRAGMA max_page_count=32768", NULL, 0, &errMsg); The sqlite initialization succeeded, but the sqlSt value always returned as zero. I also tried to change the PRAGMA syntax to "sqlSt = sqlite3_exec(zDB->sqlHandle, "PRAGMA max_page_count=32768", 0, 0, 0);", but sqlSt still returned zero instead of the max_page_count which set. Does the syntax of the PRAGMA max_page_count is correct? Do I need to first initialize the sqlite database and then to execute the PRAGMA max_page_count or vice versa? Thanks in advance for your help, Raviv. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users