Re: [sqlite] Proper way to escape table name and column name

2011-06-07 Thread Paul Linehan
2011/6/6 Jean-Christophe Deschamps : >>What is the official way to escape table name that contains a space >>and column name that contain a spaces? > You can use square brakets or double-quotes: > [This is a long name for a small table] > "This is a long name for a small

Re: [sqlite] Handling of IEEE-754 nan and +/-inf in SQLite?

2011-06-07 Thread Jean-Christophe Deschamps
>Sure, if you're just computing average() then you'll not get any NaNs. NaNs, NO (if we don't have NaNs in the set) but issues, YES. It all depends. No one knows. You don't even know what you're computing exactly. SQL interpret avg() as "take this data as a set, sum up these numerical

Re: [sqlite] Handling of IEEE-754 nan and +/-inf in SQLite?

2011-06-07 Thread Sidney Cadot
On Jun 6, 2011, at 21:55, Jean-Christophe Deschamps wrote: > You have a DOUBLE column where you need to store NaN? Go ahead and > store 'NaN' in offending rows. This cannot be done. They will be turned into NULL. Sidney ___ sqlite-users mailing

Re: [sqlite] Handling of IEEE-754 nan and +/-inf in SQLite?

2011-06-07 Thread Sidney Cadot
Hi Jay, > One should never assume a database uses IEEE 754, so one should never > assume it uses similar semantics. One should not assume it unless it is documented, of course. Postgres, for example, half-heartedly embraces IEEE-754 'on platforms that use it' (see section 8.1.3 of its manual).

[sqlite] Fwd: Possible small memory leak

2011-06-07 Thread Ronald Burgman
Hej, I was wondering about the following piece of code. It is part of the find_home_dir procedure in shell.c. 2506: #if !defined(_WIN32) && !defined(WIN32) && !defined(__OS2__) && !defined(_WIN32_WCE) && !defined(__RTP__) && !defined(_WRS_KERNEL)                struct passwd *pwent;              

Re: [sqlite] Fwd: Possible small memory leak

2011-06-07 Thread Stephan Beal
On Tue, Jun 7, 2011 at 12:31 PM, Ronald Burgman < r.w.burg...@student.utwente.nl> wrote: > Now, I'm not sure if getpwuid actually allocates memory. Some > documentation does not mention anything about it; some mention it is not > possible; some mention that getpwuid can result in an ENOMEM >

Re: [sqlite] Fwd: Possible small memory leak

2011-06-07 Thread Alessandro Marzocchi
> Now, I'm not sure if getpwuid actually allocates memory. Some > documentation does not mention anything about it; some mention it is not > possible; some mention that getpwuid can result in an ENOMEM > (allocation failed) error, > which clearly indicates that getpwuid tries to allocate some

[sqlite] Example Showing ACTUAL Use of sqlite3_auto_extension()

2011-06-07 Thread Steve and Amy
Would someone, please, show me an example (several actual, successive lines of code) in C (or C++) showing a proper use of sqlite3_auto_extension()? I have searched the web looking for examples, but there are none that I can tell. I have also, to the best of my understanding,

Re: [sqlite] Cannot load SQLite.Interop.dll but file is in the folder

2011-06-07 Thread Cyrille
Dear Pavel, Thanks for your answer. Sorry, I am not sure to understand. You mean that, in some case, the application will only work with the same .net framework used to compile the DLL. Correct? Anyway, I have directly used the DLL provided by installing SQLite. Could you please let me know

[sqlite] AIX 6.1 Autoconf support

2011-06-07 Thread Jaco Breitenbach
Dear experts, I've been trying to get SQLite compiled on an AIX 6.1 system. The configure script that came with version 3.7.3 contains several exceptions for different AIX versions, notably versions 4 and 5, but not 6. This means for example that it is unable to generate a shared library

Re: [sqlite] Example Showing ACTUAL Use of sqlite3_auto_extension()

2011-06-07 Thread Jay A. Kreibich
On Tue, Jun 07, 2011 at 07:52:37AM -0500, Steve and Amy scratched on the wall: > Would someone, please, show me an example (several actual, successive > lines of code) in C (or C++) showing a proper use of > sqlite3_auto_extension()? "Using SQLite", p209-211.

Re: [sqlite] Handling of IEEE-754 nan and +/-inf in SQLite?

2011-06-07 Thread Sidney Cadot
> Please someone show me what is the correct value of this avg() in practice. There are a number of answers to this. To the level of precision that you specified, all answer are completely fine; the error is, in all cases, very small relative to the variance of your input data. It is an

[sqlite] Dynamically loaded sqlite (linux)

2011-06-07 Thread Max Vlasov
Hi, I'm trying to use sqlite with linux (Ubuntu, Pascal, Lazarus). I'm still not very familiar with linux development so I might miss something essential. Two scenarios work ok - statically linked latest version compiled (3.7.6.3), no options or defines changed - Dynamically loaded (dlopen)

Re: [sqlite] Handling of IEEE-754 nan and +/-inf in SQLite?

2011-06-07 Thread Jay A. Kreibich
On Tue, Jun 07, 2011 at 05:38:09PM +0200, Sidney Cadot scratched on the wall: > > Please someone show me what is the correct value of this avg() in practice. > SELECT AVG(data) FROM TryAvg ORDER BY ABS(data) DESC; > > But apparently, SQLite ignores the ORDER BY clause because of the > AVG()

Re: [sqlite] Handling of IEEE-754 nan and +/-inf in SQLite?

2011-06-07 Thread Nico Williams
On Tue, Jun 7, 2011 at 4:36 AM, Jean-Christophe Deschamps wrote: > Now, please try this: You miss the point. Not every app requires extended precision. But just because you don't require extended precision doesn't mean you can't use FP at all. It depends on the app. Nico

Re: [sqlite] Dynamically loaded sqlite (linux)

2011-06-07 Thread Jay A. Kreibich
On Tue, Jun 07, 2011 at 07:47:25PM +0400, Max Vlasov scratched on the wall: > Hi, > > I'm trying to use sqlite with linux (Ubuntu, Pascal, Lazarus). I'm still not > very familiar with linux development so I might miss something essential. > > Two scenarios work ok > - statically linked latest

Re: [sqlite] Fwd: Possible small memory leak

2011-06-07 Thread Nico Williams
On Tue, Jun 7, 2011 at 5:31 AM, Ronald Burgman wrote: > Now, I'm not sure if getpwuid actually allocates memory. Some > documentation does not mention anything about it; some mention it is not > possible; some mention that getpwuid can result in an ENOMEM >

Re: [sqlite] Dynamically loaded sqlite (linux)

2011-06-07 Thread Martin Gadbois
On Tue, Jun 7, 2011 at 12:52 PM, Jay A. Kreibich wrote: > On Tue, Jun 07, 2011 at 07:47:25PM +0400, Max Vlasov scratched on the wall: > > Hi, > > > > I'm trying to use sqlite with linux (Ubuntu, Pascal, Lazarus). I'm still > not > > very familiar with linux development so I might

[sqlite] Converting sqlite3 to sqlite2.

2011-06-07 Thread Joe Goldthwaite
I've got a problem. I need to convert an sqlite3 database back to sqlite2's format on a Windows machine. I've found instructions on how to do it but they require sqlite.exe which I can't seem to find anywhere! Does anyone have a link where they can download the older version? P.S. I know the

Re: [sqlite] Converting sqlite3 to sqlite2.

2011-06-07 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/07/2011 11:41 AM, Joe Goldthwaite wrote: > The development environment I'm using is locked into > Python 2.4 and pysql for python 2.4 can only handle the older sqlite format. I'd suggest getting working with SQLite 3. SQLite 2 is positively

Re: [sqlite] Converting sqlite3 to sqlite2.

2011-06-07 Thread Joe Goldthwaite
You're right. It looks like the last release of sqlite 3 released in September '04. It seems like the version of pysqlite that I'm using, which was released Nov '09' would support it. Maybe the version of sqlite isn't my problem. I'm trying to read the Firefox cookies file (cookies.sqlite). It

Re: [sqlite] Converting sqlite3 to sqlite2.

2011-06-07 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I see you have now taken this up on the python-sqlite mailing list where we'll deal with the issue. You've seriously mixed up Python, SQLite and pyqlite issues and Firefox's databases are SQLite 3 so SQLite 2 is completely irrelevant. Roger

Re: [sqlite] Converting sqlite3 to sqlite2.

2011-06-07 Thread Joe Goldthwaite
Hi Roger, I posted over there because it started looking like it's more of a pysql problem than a sqlite 2 problem. I copied the cookies.sqlite file from Firefox 3.6 and opened it with the sqlite manager. It says the file is schema version 1, user version 2. That's a big difference from Firefox

Re: [sqlite] Converting sqlite3 to sqlite2.

2011-06-07 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/07/2011 01:52 PM, Joe Goldthwaite wrote: > It says the file is schema version 1, user version 2. That has *nothing* to do with the issue. They are just two fields within a SQLite 3 database. You can change them to any arbitrary numbers you

Re: [sqlite] Converting sqlite3 to sqlite2.

2011-06-07 Thread Richard Hipp
On Tue, Jun 7, 2011 at 4:38 PM, Joe Goldthwaite wrote: > I'm trying to read the Firefox cookies file (cookies.sqlite). It > worked fine in Firefox 3.5 and 3.6 but this is the first time I've tried it > since I upgraded to Firefox 4. Now I'm getting an error message >

Re: [sqlite] Converting sqlite3 to sqlite2.

2011-06-07 Thread Joe Goldthwaite
Thanks Richard. It's good to know exactly what the problem is. I'll stop posting about it here and follow up with the pysqlite forum. And thanks again to you Robert. I didn't realize that the Schema was just a place for the developer to leave a note. I assumed that it was the sqlite's internal

[sqlite] Implicitly creating a table containing the first N consecutive integers?

2011-06-07 Thread Guenther Brunthaler
Hi all, I frequently need a table in my queries for several kinds of JOIN operations which contains just the integers from 1 to N in its rows. I. e. SELECT n FROM int_seq where n <= 5; 1 2 3 4 5 However, I would like to achieve the same effect without actually creating such a table "int_seq".

Re: [sqlite] Implicitly creating a table containing the first N consecutive integers?

2011-06-07 Thread Petite Abeille
On Jun 7, 2011, at 11:44 PM, Guenther Brunthaler wrote: > It it possible in SQLite to create such a table implicitly "on the fly" > using some sort of recursive view/query or built-in special function? The short of it: no, not out-of-the-box. ___

Re: [sqlite] Handling of IEEE-754 nan and +/-inf in SQLite?

2011-06-07 Thread Sidney Cadot
Hi Jay >  No, this is basic SQL order of operations. You are right, that first approach I tried was definitely a brainfart. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Converting sqlite3 to sqlite2.

2011-06-07 Thread Richard Hipp
On Tue, Jun 7, 2011 at 5:41 PM, Joe Goldthwaite wrote: > I didn't realize that the Schema was just a > place for the developer to leave a note. I assumed that it was the sqlite's > internal database schema that was being used to describe some internal > control tables or

Re: [sqlite] Implicitly creating a table containing the first N consecutive integers?

2011-06-07 Thread Richard Hipp
On Tue, Jun 7, 2011 at 5:44 PM, Guenther Brunthaler wrote: > Hi all, > > I frequently need a table in my queries for several kinds of JOIN > operations which contains just the integers from 1 to N in its rows. > > I. e. > > SELECT n FROM int_seq where n <= 5; > 1 > 2 > 3 > 4

[sqlite] Re(2): Implicitly creating a table containing the first N consecutive integers?

2011-06-07 Thread Guenther Brunthaler
On 2011-06-07 23:52, Petite Abeille wrote: > The short of it: no, not out-of-the-box. Thanks for the quick reply. I guess a loadable extension needs to be used for this purpose then. Is there any such extension already known to be available? I would like to avoid reinventing the wheel. I

Re: [sqlite] Implicitly creating a table containing the first N consecutive integers?

2011-06-07 Thread Jay A. Kreibich
On Tue, Jun 07, 2011 at 11:44:20PM +0200, Guenther Brunthaler scratched on the wall: > Hi all, > > I frequently need a table in my queries for several kinds of JOIN > operations which contains just the integers from 1 to N in its rows. > > I. e. > > SELECT n FROM int_seq where n <= 5; > 1 > 2

Re: [sqlite] Converting sqlite3 to sqlite2.

2011-06-07 Thread Joe Goldthwaite
Ah! Good to know. Thank you! On Tue, Jun 7, 2011 at 3:10 PM, Richard Hipp wrote: > On Tue, Jun 7, 2011 at 5:41 PM, Joe Goldthwaite > wrote: > > > I didn't realize that the Schema was just a > > place for the developer to leave a note. I assumed that it

[sqlite] Re(3): Implicitly creating a table containing the first N consecutive integers?

2011-06-07 Thread Guenther Brunthaler
On 2011-06-08 00:12, Richard Hipp wrote: > See > http://www.sqlite.org/src/artifact/6129adfbe7c7444f2e60cc785927f3aa74e12290for >> ** Example: >> ** >> ** CREATE VIRTUAL TABLE nums USING wholenumber; >> ** SELECT value FROM nums WHERE value<10; >> ** >> ** Results in: >> ** >> ** 1 2

Re: [sqlite] Implicitly creating a table containing the first N consecutive integers?

2011-06-07 Thread Jay A. Kreibich
On Tue, Jun 07, 2011 at 06:12:55PM -0400, Richard Hipp scratched on the wall: > On Tue, Jun 7, 2011 at 5:44 PM, Guenther Brunthaler > wrote: > > See > http://www.sqlite.org/src/artifact/6129adfbe7c7444f2e60cc785927f3aa74e12290 > for an example implementation of a virtual

[sqlite] Slow rollback - possible causes?

2011-06-07 Thread Eric Sigler
Hello! Does anyone know of a reason why we might be seeing SQLite transaction rollbacks that take between 60 and 240 seconds?  (One particularly odd occurrence was almost 20 minutes long!)  This doesn't seem to happen often, but when it does it's painful.  During the rollback, the disk is

Re: [sqlite] Slow rollback - possible causes?

2011-06-07 Thread Simon Slavin
On 8 Jun 2011, at 2:02am, Eric Sigler wrote: > Does anyone know of a reason why we might be seeing SQLite transaction > rollbacks that take between 60 and 240 seconds? My initial thought was a faulty hard disk: bad sectors or a duff controller. Given that you're running inside a VM, it might

[sqlite] WAL and changing modified file time of .db file

2011-06-07 Thread YONGIL JANG
Dear all, I have a question of WAL journal mode. I'm doing some project that uses sqlite with WAL journal mode. Some days ago, I'd found DB crash and couldn't execute any SQL queries. But, for a while, I couldn't find any scenarios can make this DB crash. My question is changing modified

Re: [sqlite] Slow rollback - possible causes?

2011-06-07 Thread Pavel Ivanov
> DB file in WAL mode, checkpointing done every 5 seconds by separate > thread in program Depending on the mode of checkpointing you use it can fail if there are some other reading or writing transactions in progress. And at the time you observe very long rollback actual checkpointing happens

Re: [sqlite] Slow rollback - possible causes?

2011-06-07 Thread Eric Sigler
We haven't watched the WAL continuously, but we have noticed that the WAL file grows slowly in size over time between application restarts (around every 2 weeks). Currently, the WAL file for one of our DBs is around 40MB, we've seen it grow up to 130MB or so. I'll try to catch the WAL size and

Re: [sqlite] Slow rollback - possible causes?

2011-06-07 Thread Pavel Ivanov
> (Actually, that was another general question we had, should that WAL > file ever shrink during use?  Why would it grow to that size at all?) It shrinks, when the full checkpoint is completed successfully. Until then it grows. Pavel On Tue, Jun 7, 2011 at 10:03 PM, Eric Sigler

Re: [sqlite] Slow rollback - possible causes?

2011-06-07 Thread Eric Sigler
So, should the WAL file shrink back to 0 then? We're issuing "PRAGMA wal_checkpoint" to the open DB handle. -Eric On Tue, Jun 7, 2011 at 7:06 PM, Pavel Ivanov wrote: >> (Actually, that was another general question we had, should that WAL >> file ever shrink during use?  Why

Re: [sqlite] Slow rollback - possible causes?

2011-06-07 Thread Pavel Ivanov
> We're issuing "PRAGMA > wal_checkpoint" to the open DB handle. If you want guaranteed finish of the checkpoint (and thus not growing WAL-file) you need to issue "PRAGMA wal_checkpoint(RESTART)". Pavel On Tue, Jun 7, 2011 at 10:36 PM, Eric Sigler wrote: > So, should

[sqlite] sqlite shell tab autocompletion

2011-06-07 Thread prad
apsw gives a decent completion but runs into issues with python2: see roger binns post 16 aug 03:24 here: http://comments.gmane.org/gmane.comp.python.db.sqlite.user/187 (a solution is provided too in this post though i haven't tried it) what tools are available to provide a decent console

Re: [sqlite] sqlite shell tab autocompletion

2011-06-07 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/07/2011 08:02 PM, prad wrote: > apsw gives a decent completion but runs into issues with python2: > see roger binns post 16 aug 03:24 here: > http://comments.gmane.org/gmane.comp.python.db.sqlite.user/187 > (a solution is provided too in this

Re: [sqlite] sqlite shell tab autocompletion

2011-06-07 Thread prad
Roger Binns writes: > On 06/07/2011 08:02 PM, prad wrote: >> apsw gives a decent completion but runs into issues with python2: >> see roger binns post 16 aug 03:24 here: >> http://comments.gmane.org/gmane.comp.python.db.sqlite.user/187 >> (a solution is provided too in