[sqlite] Is it possible that dropping a big table takes very long

2016-04-25 Thread E.Pasma
23 apr 2016, E.Pasma: > Hello, > I tried the scripts but.. > > createBigTable.sh is beyond the capacity of my system. Instead I > used SQL script like in > www.mail-archive.com/sqlite-users%40mailinglists.sqlite.org/msg08044.html > > My point is that the definition of the table is a waste of

[sqlite] No datasize field - why?

2016-04-25 Thread Simon Slavin
On 25 Apr 2016, at 1:42am, James K. Lowden wrote: > Simon Slavin wrote: > >> Another reason is that we use Unicode not ASCII/SIXBIT/EBCDIC, and in >> Unicode different characters take different numbers of bytes. So >> even if you're storing a fixed number of bytes the convenience of >>

[sqlite] SQLITE_CANTOPEN on Android

2016-04-25 Thread Clemens Ladisch
Martin Trnovec wrote: > D?a 24.04.2016 o 8:39 Clemens Ladisch nap?sal(a): >> Android (and Chromium on Android) just use SQLITE_TEMP_STORE=3 for this >> reason >> >> Apparently, Martin's SQLite library was compiled differently. > > That's right we have our own build of sqlite included in c++ common

[sqlite] No datasize field - why?

2016-04-25 Thread Dominique Devienne
On Mon, Apr 25, 2016 at 3:31 AM, Simon Slavin wrote: > > These are different concerns, and they don't really pose any > > difficulty. Given an encoding, a column of N characters can take up to > > x * N bytes. Back in the day, "x" was 1. Now it's something else. No > > big deal. > > No.

[sqlite] No datasize field - why?

2016-04-25 Thread Scott Robison
On Mon, Apr 25, 2016 at 1:08 AM, Dominique Devienne wrote: > On Mon, Apr 25, 2016 at 3:31 AM, Simon Slavin > wrote: > > > > These are different concerns, and they don't really pose any > > > difficulty. Given an encoding, a column of N characters can take up to > > > x * N bytes. Back in the

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Mark Foley
I'm new to the list, so apologies if this has been posted before. I am using sqlite3 3.7.17 on Linux Slackware64 14.1. I use the sqlite3 command every 10 minutes to query several Thunderbird calendar databases. Occasionally, I have a message, "Error: database is locked"; understandable since

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Dominique Devienne
On Mon, Apr 25, 2016 at 2:33 PM, Mark Foley wrote: > I'm new to the list, so apologies if this has been posted before. > > I am using sqlite3 3.7.17 on Linux Slackware64 14.1. I use the sqlite3 > command > every 10 minutes to query several Thunderbird calendar databases. > Occasionally, I > have

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Simon Slavin
On 25 Apr 2016, at 1:33pm, Mark Foley wrote: > I am using sqlite3 3.7.17 on Linux Slackware64 14.1. I use the sqlite3 > command every 10 minutes to query several Thunderbird calendar databases. > Occasionally, I > have a message, "Error: database is locked"; understandable since Thunderbird >

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Richard Hipp
On 4/25/16, Mark Foley wrote: > I'm new to the list, so apologies if this has been posted before. > > I am using sqlite3 3.7.17 on Linux Slackware64 14.1. I use the sqlite3 > command > every 10 minutes to query several Thunderbird calendar databases. > Occasionally, I > have a message, "Error:

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Mark Foley
On Mon, 25 Apr 2016 14:41:30 Dominique Devienne wrote: > Perhaps you're missing the leading file: ? I believe it is required. --DD No, unless I'm putting it in the wrong place. As I wrote I did: $ sqlite3 "myDbpath?mode=ro" I also tried escaping the '?' as '\?', no go. Should this work from

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Mark Foley
On Mon, 25 Apr 2016 13:41:36 Simon Slavin wrote: > You may get a better result by adding a timeout before your SELECT: > > PRAGMA busy_timeout=5000;SELECT > From: Simon Slavin Thanks, I just tried that. It's a good ides, but the problem is that the PRAGMA statement echo the timeout value to

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Mark Foley
On Mon, 25 Apr 2016 08:42:26 Richard Hipp wrote: > If you put the databases in WAL-mode (https://www.sqlite.org/wal.html) > using "PRAGMA journal_mode=WAL;" then this problem will likely go away > (depending on what it is that Thunderbird is doing.) I suggest trying > that approach first.

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Richard Hipp
On 4/25/16, Mark Foley wrote: > > Thanks, I just tried that. It's a good ides, but the problem is that the > PRAGMA > statement echo the timeout value to stdout: > Can you use the ".once /dev/null" command prior to the "PRAGMA" to suppress the output? sqlite3 "mydbpath" -cmd ".once /dev/null"

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Simon Slavin
On 25 Apr 2016, at 2:00pm, Mark Foley wrote: > problem is that the PRAGMA > statement echo the timeout value to stdout: > > sqlite3 "mydbpath" \ > "PRAGMA busy_timeout=5000;select distinct value from cal_properties where key > = 'CATEGORIES'" > 5000 > Orange Category > Green Category > Blue

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Richard Hipp
On 4/25/16, Mark Foley wrote: > > I wonder, then, why I get a lock error if the database is read-only in the > first > place? The reader has to get a read lock in order to prevent a concurrent writer from changing content out from under it. (Moving the database to WAL mode allows readers and

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Dominique Devienne
On Mon, Apr 25, 2016 at 2:53 PM, Mark Foley wrote: > On Mon, 25 Apr 2016 14:41:30 Dominique Devienne > wrote: > > > Perhaps you're missing the leading file: ? I believe it is required. --DD > > No, unless I'm putting it in the wrong place. As I wrote I did: $ sqlite3 "myDbpath?mode=ro" >

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Mark Foley
on Mon, 25 Apr 2016 09:10:58 Richard Hipp wrote: > Can you use the ".once /dev/null" command prior to the "PRAGMA" to > suppress the output? sqlite3 -cmd ".once /dev/null" -cmd "PRAGMA busy_timeout=5000" "mydbpath" \ "select distinct value from cal_properties where key = 'CATEGORIES'" Error:

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Mark Foley
Simon, As I just wrote to Richard Hipp, I must not have the .once command, but see my reply for a possible solution using .timeout and tell me what you think. I'm not sure what the -cmd really does. It is not described in my man page. --Mark -Original Message- > From: Simon Slavin >

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Simon Slavin
On 25 Apr 2016, at 2:28pm, Mark Foley wrote: > As I just wrote to Richard Hipp, I must not have the .once command, but see > my reply for a possible solution using .timeout and tell me what you think. Yep. That should work. In fact it's a better solution than mine. Simon.

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Mark Foley
This is probably taking us down another path, but how would my query succeed at all if I need a lock to read and the DB file itself is read-only? My normal queries do work fine, even if the directory is mounted read-only. --Mark -Original Message- > Date: Mon, 25 Apr 2016 09:14:14 -0400

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Richard Hipp
On 4/25/16, Mark Foley wrote: > > Perhaps too old a version of sqlite3? Doing .help does not list .once, > Added to SQLite 3.8.5, circa 2014-06-04. -- D. Richard Hipp drh at sqlite.org

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Richard Hipp
On 4/25/16, Mark Foley wrote: > This is probably taking us down another path, but how would my query succeed > at > all if I need a lock to read and the DB file itself is read-only? > Most systems allow you to obtain a read-lock on a read-only file. -- D. Richard Hipp drh at sqlite.org

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Mark Foley
On Mon, 25 Apr 2016 15:14:56 Dominique Devienne wrote: > Please (re)read the example I included. --DD > > C:\Users\DDevienne>sqlite3 *file:*new.db?mode=ro Sorry, perhaps I'm a bit obtuse. I don't see how your example differs from mine: sqlite "mydbpath?mode=ro" Are you referring to the

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Mark Foley
OK, I'm at 3.7.17, so too old for .once. --Mark -Original Message- > Date: Mon, 25 Apr 2016 09:32:48 -0400 > From: Richard Hipp > To: SQLite mailing list > Subject: Re: [sqlite] sqlite3 command line, read-only > > On 4/25/16, Mark Foley wrote: > > > > Perhaps too old a version of

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Mark Foley
OK, I'll go with that and see if I get any more lock errors. --Mark -Original Message- From: Simon Slavin Date: Mon, 25 Apr 2016 14:30:26 +0100 To: SQLite mailing list On 25 Apr 2016, at 2:28pm, Mark Foley wrote: > As I just wrote to Richard Hipp, I must not

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Dominique Devienne
On Mon, Apr 25, 2016 at 3:35 PM, Mark Foley wrote: > On Mon, 25 Apr 2016 15:14:56 Dominique Devienne > wrote: > > Please (re)read the example I included. --DD > > C:\Users\DDevienne>sqlite3 *file:*new.db?mode=ro > > Sorry, perhaps I'm a bit obtuse. I don't see how your example differs from >

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Mark Foley
I'm running this on Linux. That Windows notation doesn't work. sqlite3 "*file:*/mnt/tmp/Users/.../AppData/Roaming/Thunderbird/Profiles/8sbpxrwj.default/calendar-data/local.sqlite\?mode=ro" "select distinct value from cal_properties where key = 'CATEGORIES'" Error: unable to open database

[sqlite] No datasize field - why?

2016-04-25 Thread James K. Lowden
On Mon, 25 Apr 2016 02:31:25 +0100 Simon Slavin wrote: > > These are different concerns, and they don't really pose any > > difficulty. Given an encoding, a column of N characters can take > > up to x * N bytes. Back in the day, "x" was 1. Now it's something > > else. No big deal. > > No.

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Dominique Devienne
On Mon, Apr 25, 2016 at 4:28 PM, Mark Foley wrote: > I'm running this on Linux. That Windows notation doesn't work. > > sqlite3 > "*file:*/mnt/tmp/Users/.../AppData/Roaming/Thunderbird/Profiles/8sbpxrwj.default/calendar-data/local.sqlite\?mode=ro" > "select distinct value from cal_properties

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Mark Foley
Dominique, Nope: still error: sqlite3 \ '*file:*/mnt/tmp/Users/hcarr.HPRS.000/AppData/Roaming/Thunderbird/Profiles/8sbpxrwj.default/calendar-data/local.sqlite?mode=ro' \ "select distinct value from cal_properties where key = 'CATEGORIES'" Error: unable to open database

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Simon Slavin
On 25 Apr 2016, at 5:12pm, Mark Foley wrote: > Error: unable to open database > "*file:*/mnt/tmp/Users/hcarr.HPRS.000/AppData/Roaming/Thunderbird/Profiles/8sbpxrwj.default/calendar-data/local.sqlite?mode=ro": > unable to open database file That path looks like it has two components which

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Dominique Devienne
On Mon, Apr 25, 2016 at 6:12 PM, Mark Foley wrote: > Nope: still error: > > sqlite3 \ > '*file:*/mnt/tmp/Users/hcarr.HPRS.000/AppData/Roaming/Thunderbird/Profiles/8sbpxrwj.default/calendar-data/local.sqlite?mode=ro' > \ > "select distinct value from cal_properties where key = 'CATEGORIES'" >

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Mark Foley
On Mon, 25 Apr 2016 17:15:20 Simon Slavin wrote: > Try ls > /mnt/tmp/Users/hcarr.HPRS.000/AppData/Roaming/Thunderbird/Profiles/8sbpxrwj.default/calendar-data/ > > and see what you get. You may have to change it to suit your installation. $ ls -l

[sqlite] sqlite3 command line, read-only

2016-04-25 Thread Mark Foley
Yes, I am typing the stars in. That was my question to you to which you replied in your message of 15:47 +0200 >> Are you referring to the "*file:*" syntax? > > Precisely: https://www.sqlite.org/uri.html --DD I took you litterally, no I didn't look up the URL. ANYWAY, Yes!!! That works removing

[sqlite] No datasize field - why?

2016-04-25 Thread Scott Robison
On Mon, Apr 25, 2016 at 8:38 AM, James K. Lowden wrote: > On Mon, 25 Apr 2016 02:31:25 +0100 > Simon Slavin wrote: > > > > These are different concerns, and they don't really pose any > > > difficulty. Given an encoding, a column of N characters can take > > > up to x * N bytes. Back in the