Re: [sqlite] sqlite3 connect spawns additional thread

2006-07-12 Thread drh
Iker Arizmendi <[EMAIL PROTECTED]> wrote: > Using pysqlite2 I noticed (using ps) that whenever I connected to > a database for the first time an extra thread is spawned. At first > I thought this might be the doing of pysqlite but a quick test with > the sqlite3 command line tool confirmed that

Re: [sqlite] sqlite3 connect spawns additional thread

2006-07-12 Thread Iker Arizmendi
My version of Linux is still using LinuxThreads (as opposed to NPTL) - I guess that extra thread is the "manager" thread. Iker On 7/12/06, Iker Arizmendi <[EMAIL PROTECTED]> wrote: Using pysqlite2 I noticed (using ps) that whenever I connected to a database for the first time an extra thread

Re: [sqlite] Problems with Multi-Threaded Application.

2006-07-12 Thread John Stanton
To write to the database use a single thread with a single DB instance operating sync'd on a mutex to force exclusive write. Reads can be anytime, provided they wait on the mutex and set it as a read lock. You might find that to let writes queue until either an alarm triggers or the queue

[sqlite] sqlite3 connect spawns additional thread

2006-07-12 Thread Iker Arizmendi
Using pysqlite2 I noticed (using ps) that whenever I connected to a database for the first time an extra thread is spawned. At first I thought this might be the doing of pysqlite but a quick test with the sqlite3 command line tool confirmed that this occurs within sqlite3 itself: $ sqlite3

Re: [sqlite] Question about database?

2006-07-12 Thread John Stanton
Jay gave you the clue. You need to have software and hardware which will address data beyond 32 bits, i.e. 64 bit file addressing. The 64 bit file version of all the tools you mention should perform your job. Now you choose according to the scale of your application, Enterprise,

Re: [sqlite] Question about database?

2006-07-12 Thread John Stanton
Cesar David Rodas Maldonado wrote: Hello to everybody! I want to ask to the people something... If i have a table with about 8.000.000.000 registers, and i have to do a select in a numeric row that will have index. what db do you recommend to me for use? Thanxs (:D) people! How many

Re: [sqlite] Question about database?

2006-07-12 Thread Eduardo
At 19:59 12/07/2006, you wrote: 32 bits, the size of the key, only holds numbers up to 2 or 4 billion. You said you have 8 billion rows. You need a 64 bit version or to split up the data into many tables. On 7/12/06, Cesar David Rodas Maldonado <[EMAIL PROTECTED]> wrote: So Jay... Do you

[sqlite] using max value

2006-07-12 Thread Keiichi McGuire
I'm a bit stuck on this one problem I have this simple table that has two fields: id and value. What I want to do is to get the largest id (the last entry) and then add an arbitrary number to the value that's in the same entry as that one, and put the result in the next entry. to make it sound

Re: [sqlite] How do you find out the names of the fields within a table?

2006-07-12 Thread Nuno Lucas
On 7/12/06, John Newby <[EMAIL PROTECTED]> wrote: Hi, how can I find out the names of the fields within a given table? I've tried "pragma table_info(test);" but this brings back too much info, I just require the names as I'll be storing them in an array within my application. When you use

Re: [sqlite] How do you find out the names of the fields within a table?

2006-07-12 Thread Kees Nuyt
On Wed, 12 Jul 2006 19:05:51 +0100, you wrote: > Hi, how can I find out the names of the > fields within a given table? > > I've tried "pragma table_info(test);" > but this brings back too much info, > I just require the names as I'll be > storing them in an array within my application. Your

Re: [sqlite] Question about database?

2006-07-12 Thread Jay Sprenkle
On 7/12/06, Gussimulator <[EMAIL PROTECTED]> wrote: Yeah and while we're at it, he could invest a few bucks on a couple twin diesel generators, a battery room, and whatnot, a group of hookers to save the night. You forgot the beer and pizza delivery contract!

Re: [sqlite] Question about database?

2006-07-12 Thread Cesar David Rodas Maldonado
Gussimulator No entendi tu mensaje, podrias porfavor escribirmelo en español On 7/12/06, Gussimulator <[EMAIL PROTECTED]> wrote: Yeah and while we're at it, he could invest a few bucks on a couple twin diesel generators, a battery room, and whatnot, a group of hookers to save the night.

Re: [sqlite] Question about database?

2006-07-12 Thread Gussimulator
Yeah and while we're at it, he could invest a few bucks on a couple twin diesel generators, a battery room, and whatnot, a group of hookers to save the night. - Original Message - From: "Jay Sprenkle" <[EMAIL PROTECTED]> To: Sent: Wednesday, July 12, 2006

AW: [sqlite] Problems with Multi-Threaded Application.

2006-07-12 Thread Michael Ruck
Use a queue for the database operations in this case. You won't suffer from lock or busy errors, if all access is serialized. Queues can scale very well if done right. Mike -Ursprüngliche Nachricht- Von: Gussimulator [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 12. Juli 2006 20:55 An:

Re: [sqlite] Problems with Multi-Threaded Application.

2006-07-12 Thread Gussimulator
Yes but I'd rather move to another database solution then. As I see it, sqlite could well have such system built-in, no, it wouldnt be bloat. The queue system will work, as I mentioned I already thought of it, but, I don't think its an elegant solution. I could avoid the "can't read while

Re: [sqlite] Problems with Multi-Threaded Application.

2006-07-12 Thread Gussimulator
I cannot delay my thread. Also, if I made a thread per event, then that wouldnt work either, since every thread would open the database to try a write on it. We are talking about 100 events in a second. This thread handles the queries as it gets the events. - Original Message -

Re: [sqlite] Question about database?

2006-07-12 Thread Jay Sprenkle
On 7/12/06, Cesar David Rodas Maldonado <[EMAIL PROTECTED]> wrote: I don't care about hardware... i will do cluster... but which DB motor do think will be good for work with great velocity in select (sqlite, postgresql or mysql). ah.. i almost forgot... i will do a great number of select... I

Re: [sqlite] Encoding with spanish characters

2006-07-12 Thread Will Leshner
On 7/12/06, Pedro J. Vivancos <[EMAIL PROTECTED]> wrote: I'm developing a program using C++ and SQLite3 as database. I have a problem with encoding when I try to execute a SQL query with some characters like "ñ, á, é, í, ó, ú". My db is UTF-8 encoded and when I'm debugging I can see that the

Re: [sqlite] Question about database?

2006-07-12 Thread Cesar David Rodas Maldonado
I don't care about hardware... i will do cluster... but which DB motor do think will be good for work with great velocity in select (sqlite, postgresql or mysql). ah.. i almost forgot... i will do a great number of select... On 7/12/06, Jay Sprenkle <[EMAIL PROTECTED]> wrote: 32 bits, the size

[sqlite] How do you find out the names of the fields within a table?

2006-07-12 Thread John Newby
Hi, how can I find out the names of the fields within a given table? I've tried "pragma table_info(test);" but this brings back too much info, I just require the names as I'll be storing them in an array within my application. Many thanks John

Re: [sqlite] Question about database?

2006-07-12 Thread Jay Sprenkle
32 bits, the size of the key, only holds numbers up to 2 or 4 billion. You said you have 8 billion rows. You need a 64 bit version or to split up the data into many tables. On 7/12/06, Cesar David Rodas Maldonado <[EMAIL PROTECTED]> wrote: So Jay... Do you think that i have to use a PC of 64

Re: [sqlite] Problems with Multi-Threaded Application.

2006-07-12 Thread Jay Sprenkle
On 7/12/06, Gussimulator <[EMAIL PROTECTED]> wrote: About the "cant read while writing", how to avoid this?, I cant stop my system while using the database. There would be no point on having a database then. check the return code from operation, if it says Busy, or Locked, the redo the

AW: [sqlite] Problems with Multi-Threaded Application.

2006-07-12 Thread Michael Ruck
I would suggest using a queue approach. Its not as bad as it sounds. Have that queue processed by a single thread, which controls the database writes. That way you can save the time for other operations, such as database open/close etc. You can't avoid the "can't read while writing" though.

Re: [sqlite] Question about database?

2006-07-12 Thread Cesar David Rodas Maldonado
So Jay... Do you think that i have to use a PC of 64 bits, or 32bits pc with clustering? On 7/12/06, Jay Sprenkle <[EMAIL PROTECTED]> wrote: > Hello to everybody! > > I want to ask to the people something... If i have a table with about > 8.000.000.000 registers, and i have to do a select in

[sqlite] Encoding with spanish characters

2006-07-12 Thread Pedro J. Vivancos
Dear friends, I'm developing a program using C++ and SQLite3 as database. I have a problem with encoding when I try to execute a SQL query with some characters like "ñ, á, é, í, ó, ú". My db is UTF-8 encoded and when I'm debugging I can see that the sentence is right but I have no result.

Re: [sqlite] Problems with Multi-Threaded Application.

2006-07-12 Thread Gussimulator
Yes, in theory. However, when about 100 queries are fired in a second, only a few get the data populated.. I can not tell when to start or end the transactions, because events are fired from a third-party system. So I used a timer, set to 5 seconds.. then tried with 10 seconds, got the same

[sqlite] Re: Question about database?

2006-07-12 Thread Cesar David Rodas Maldonado
Hello to everybody! I want to ask to the people something... If i have a table with about 8.000.000.000 registers, and i have to do a select in a numeric row that will have index. what db do you recommend to me for use? Thanxs (:D) people!

Re: [sqlite] CREATE IF NOT EXISTS and locks

2006-07-12 Thread drh
Iker Arizmendi <[EMAIL PROTECTED]> wrote: > When a statement of the form: > > CREATE TABLE xxx IF NOT EXISTS > > what sort of locking overhead is incurred in the case > where the table already exists? > If the table already exists, no locking occurs. The statement above is a no-op. -- D.

[sqlite] CREATE IF NOT EXISTS and locks

2006-07-12 Thread Iker Arizmendi
When a statement of the form: CREATE TABLE xxx IF NOT EXISTS what sort of locking overhead is incurred in the case where the table already exists? Regards, Iker -- Iker Arizmendi e: [EMAIL PROTECTED] w: ikerariz.blogspot.com

[sqlite] Question about database?

2006-07-12 Thread Cesar David Rodas Maldonado
Hello to everybody! I want to ask to the people something... If i have a table with about 8.000.000.000 registers, and i have to do a select in a numeric row that will have index. what db do you recommend to me for use? Thanxs (:D) people!

Re: [sqlite] Problems with Multi-Threaded Application.

2006-07-12 Thread Jay Sprenkle
On 7/12/06, Gussimulator <[EMAIL PROTECTED]> wrote: Hello, I'm currently using SQLite3 on my multi-threaded software. I have tried several ways for dealing with my issue, however, I came to the conclusion that there must be some trick I havent been told of. It wasn't clear to me when I

Re: [sqlite] SQL error: database disk image is malformed

2006-07-12 Thread Bull219
First of, thank you very much Christian for replying so precisely to my message. Things to check: - Multiple processes accessing the database file. SQLite will arbitrate access using a well defined locking protocol. If a process does not respect this protocol, or locking is defective (NFS

[sqlite] Problems with Multi-Threaded Application.

2006-07-12 Thread Gussimulator
Hello, I'm currently using SQLite3 on my multi-threaded software. I have tried several ways for dealing with my issue, however, I came to the conclusion that there must be some trick I havent been told of. Heres the situation, Theres a big amount of input coming in from the software to the

Re: [sqlite] Unable to write to database

2006-07-12 Thread Gregary Hendricks
On Wed, 2006-07-12 at 01:12 +0100, Nuno Lucas wrote: > On 7/12/06, Gregary Hendricks <[EMAIL PROTECTED]> wrote: > > Greetings fellow SQLiters, > > > > I am having a bad hair day as a result of an error I am getting with my > > SQLite database. > > > > I am running SQLite 3.3.6 on SuSE linux 9.3 >

Re: [sqlite] problems compiling with arm-linux-gcc

2006-07-12 Thread Keiichi McGuire
thanks! I was able to compile sqlite for the arm architecture. I followed the directions here: http://www.sqlite.org/cvstrac/wiki?p=HowToCompile=1070624069 but modified it so it looks like this: unzip sqlite_source.zip rm tclsqlite.c for i in *.c; do arm-linux-gcc -O -c $i; done rm shell.o

Re: [sqlite] problems compiling with arm-linux-gcc

2006-07-12 Thread Glenn
Christian Smith wrote: Keiichi McGuire uttered: This is a bit confusing, especially since if I compile it using gcc it will compile w/o any problems. What would this "incompatibility" mean and what would a solution be to make it compatible and be found by the compiler? Chances are that

Re: [sqlite] problems compiling with arm-linux-gcc

2006-07-12 Thread John Stanton
Getting an executable requires two steps. First you compile the application program then you link the output of the compiler with standard and special link libraries. I am not familiar with your setup and don't know what Linux distribution you are using or machine you are running but seeing

Re: [sqlite] problems compiling with arm-linux-gcc

2006-07-12 Thread John Stanton
The error message you got says that libsqlite.a is incompatible. GCC is working fine, it is the link libraries which are the problem. If you get a source release of Sqlite, run "configure" and compile it then install you will have a known environment. Keiichi McGuire wrote: This is a bit

Re: [sqlite] problems compiling with arm-linux-gcc

2006-07-12 Thread David Bicking
Sorry, Hopefully someone else can give you advice to get past this. I will say the time I had an "incompatible" library, I was using a binary copy that had been cross-compiled. My solution was to take that library (which was otk) and compile it directly on my linux box. Why that made a difference

RE: [sqlite] RE: Problem executing sqlite3_prepare command

2006-07-12 Thread Shields, Daniel
> Never mind. I just realized (from rereading a previous newsgroup > posting) that the wildcards can only be used to replace values within > expressions (and not the table or column names). > > I use printf for these cases before preparing: sprintf(buf, "INSERT INTO %s VALUES (?,

[sqlite] Re: Virtual Table: Interface concerns

2006-07-12 Thread Salvador Fandiño
Hi, Ralf Junker wrote: > 2. xBestIndex / xFilter / sqlite3_index_info > > The sqlite3_index_info structure contains char *idxStr; which may be used to > the application's liking. In addition, int needToFreeIdxStr; can be used to > instruct SQLite3 to free idxStr. > > Would it be possible

Re: [sqlite] INT and INTEGER are not same, behaves differently (for PRIMARY KEY) ?

2006-07-12 Thread Jens Miltner
Am 12.07.2006 um 11:16 schrieb RohitPatel: INT and INTEGER behaves differently (for PRIMARY KEY) !!! (SQLite 3.3.4) create table t1 ( id INTEGER PRIMARY KEY ); create table t2 ( id INT PRIMARY KEY ); insert into t1 values(NULL); insert into t1 values(NULL); insert into t2 values(NULL);

Re: [sqlite] SQL error: database disk image is malformed

2006-07-12 Thread Christian Smith
Bull219 uttered: Dear all, I am developping a freeware which uses SQLite. One of my beta testers informed me about an issue he had: with his DB, following the query which is sent to the DB, I have the error in the subject of this email. I did some testing, and when I succeeded in

Re: [sqlite] problems compiling with arm-linux-gcc

2006-07-12 Thread Christian Smith
Keiichi McGuire uttered: This is a bit confusing, especially since if I compile it using gcc it will compile w/o any problems. What would this "incompatibility" mean and what would a solution be to make it compatible and be found by the compiler? Chances are that the libsqlite.a you're

[sqlite] INT and INTEGER are not same, behaves differently (for PRIMARY KEY) ?

2006-07-12 Thread RohitPatel9999
INT and INTEGER behaves differently (for PRIMARY KEY) !!! (SQLite 3.3.4) create table t1 ( id INTEGER PRIMARY KEY ); create table t2 ( id INT PRIMARY KEY ); insert into t1 values(NULL); insert into t1 values(NULL); insert into t2 values(NULL); insert into t2 values(NULL); /* insert into t1

Re: [sqlite] id INTEGER PRIMARY KEY vs PRIMARY KEY (id) ???

2006-07-12 Thread RohitPatel9999
Thank you very much for clearing my doubt. Rohit. -- View this message in context: http://www.nabble.com/id-INTEGER-PRIMARY-KEY--vs--PRIMARY-KEY-%28id%29-tf1922943.html#a5285302 Sent from the SQLite forum at Nabble.com.