[sqlite] Is this a bug ? How to rename a table and all dependencies ?

2015-08-21 Thread sqlite-mail
That's why I think that expose a basic SQL ANSI catalog would make this kind of work and others a lot easier. ? > Fri Aug 21 2015 22:13:00 CEST from "Simon Slavin" >Subject: Re: [sqlite] Is this a bug ? How to rename a table and all >dependencies ? > > On 21 Aug 2015, at 9:07pm, Scott

[sqlite] BUG: sqlite 3.8.11.x left join

2015-08-21 Thread Richard Hipp
The on-line fix (https://www.sqlite.org/src/artifact/24323faac?ln=3785) together with commentary and test cases is now on trunk (https://www.sqlite.org/src/info/351bc22fa9b5a2e5}. On 8/21/15, Richard Hipp wrote: > Thanks for the test case. The error seems to have been introduced by > check-in

[sqlite] design problem involving trigger

2015-08-21 Thread Will Parsons
On 21 Aug 2015, Scott Robison wrote: > Another consideration: it is possible that two different anonymous books > are indeed different books. It is also possible a given "author" releases a > new rewritten book with the same name. I'm thinking of the Hardy Boys > series in particular from my

[sqlite] design problem involving trigger

2015-08-21 Thread Will Parsons
On 21 Aug 2015, R.Smith wrote: > > > On 2015-08-21 04:47 AM, Will Parsons wrote: >> I'm working on a program that involves a catalogue of books. Part of >> the database schema looks like this: >> >> create table Books(id integer primary key, >> title text collate nocase not

[sqlite] Is this a bug ? How to rename a table and all dependencies ?

2015-08-21 Thread Simon Slavin
On 21 Aug 2015, at 9:07pm, Scott Hess wrote: > That said, writing code to do this manually has potential to be error > prone. It might make sense under an ENABLE flag. It feels like an obvious > thing to have, not something out-of-scope like embedding a new language or > support for a new

[sqlite] Is this a bug ? How to rename a table and all dependencies ?

2015-08-21 Thread Simon Slavin
On 21 Aug 2015, at 8:13pm, Scott Hess wrote: > Since renameTriggerFunc() > follows renameParentFunc(), my guess is that triggers are also handled. The documentation says that statements within TRIGGERs are not changed correctly: Perhaps

[sqlite] libtclsqlite3 assistance

2015-08-21 Thread jungle Boogie
Hi Dr. H, On 21 August 2015 at 14:23, Richard Hipp wrote: > On 8/21/15, jungle Boogie wrote: >> >> Is it possible to compile in libtclsqlite3? >> > > Dunno. But you can compile the libtclsqlite3.so yourself: > > make tclsqlite3.c > gcc -fPIC -shared -I. -o libtclsqlite3.so tclsqlite3.c

[sqlite] Is this a bug ? How to rename a table and all dependencies ?

2015-08-21 Thread sqlite-mail
Thank you for your attention ! I'm pointing this here because postgresql do manage this case properly ! And I'm creating a tool to prototype database applications and I'm using sqlite as the primary database, when we are prototyping things can change drastically at any point and if we

[sqlite] Is this a bug ? How to rename a table and all dependencies ?

2015-08-21 Thread sqlite-mail
Thanks for your attention! Only to remark on this I tested on postgresql and somehow it knows how deal with it ! "so few (none?)" Cheers ! ? > Fri Aug 21 2015 19:08:58 CEST from "J Decker" Subject: >Re: [sqlite] Is this a bug ? How to rename a table and all dependencies ? > > On

[sqlite] BUG: sqlite 3.8.11.x left join

2015-08-21 Thread Richard Hipp
Thanks for the test case. The error seems to have been introduced by check-in https://www.sqlite.org/src/info/6df18e949d367629 which does some aggressive transformations on nested queries for improved performance. On 8/21/15, Mark Brand wrote: > Hi, > > For the query below, versions 3.8.11.0

[sqlite] Is this a bug ? How to rename a table and all dependencies ?

2015-08-21 Thread Simon Slavin
On 21 Aug 2015, at 7:02pm, sqlite-mail wrote: > I'm pointing this here because postgresql do manage this case properly ! If you want postgres, you know where to find it. Please don't forget that SQLite has to run on your smartphone and your SatNav device and your TV. It has different design

[sqlite] Is this a bug ? How to rename a table and all dependencies ?

2015-08-21 Thread sqlite-mail
Then do you think this is a bug ? > Fri Aug 21 2015 18:57:33 CEST from "Simon Slavin" >Subject: Re: [sqlite] Is this a bug ? How to rename a table and all >dependencies ? > > On 21 Aug 2015, at 12:20pm, sqlite-mail wrote: > > >>Does anybody knows how to rename a table and all it's

[sqlite] Is this a bug ? How to rename a table and all dependencies ?

2015-08-21 Thread Simon Slavin
On 21 Aug 2015, at 12:20pm, sqlite-mail wrote: > Does anybody knows how to rename a table and all it's dependencies in one go > ? Can't be done. Sorry. Simon.

[sqlite] Is this a bug ? Pragmas do not accept qualified names !

2015-08-21 Thread sqlite-mail
Thank you ! That's what I want and looking back in the sqlite documentation I can see now that I was misinterpreting it, in reality I was applying the same principle used on other places to qualify/prefix tables/views/... objects but with your help I could realize that pragmas are an exception

[sqlite] libtclsqlite3 assistance

2015-08-21 Thread Richard Hipp
On 8/21/15, jungle Boogie wrote: > > Is it possible to compile in libtclsqlite3? > Dunno. But you can compile the libtclsqlite3.so yourself: make tclsqlite3.c gcc -fPIC -shared -I. -o libtclsqlite3.so tclsqlite3.c -- D. Richard Hipp drh at sqlite.org

[sqlite] Is this a bug ? Pragmas do not accept qualified names !

2015-08-21 Thread sqlite-mail
Hello ! Today I'm working with sqlite3 with attached databases and when I tried to get info about a tbale using "PRAGMA TABLE_INFO" I discovered that pragmas do not work with qualified/prefixed names like: PRAGMA table_info(attached_db.one_table) ? Is this a bug ? Cheers !

[sqlite] design problem involving trigger

2015-08-21 Thread Hick Gunter
Are you looking for "NOT NULL DEFAULT 0"? -Urspr?ngliche Nachricht- Von: Will Parsons [mailto:varro at nodomain.invalid] Gesendet: Freitag, 21. August 2015 04:47 An: sqlite-users at mailinglists.sqlite.org Betreff: [sqlite] design problem involving trigger I'm working on a program that

[sqlite] When sqlite3_close() returns SQL_BUSY

2015-08-21 Thread Dan Kennedy
On 08/21/2015 12:30 PM, Jeff M wrote: > Sometimes my iOS app creates an unreasonable number of prepared statements > (perhaps 1,000, an app bug that I'm fixing). These prepared statements are > later finalized just prior to doing sqlite3_close(), which sometimes returns > SQL_BUSY. The docs

[sqlite] design problem involving trigger

2015-08-21 Thread R.Smith
On 2015-08-21 04:47 AM, Will Parsons wrote: > I'm working on a program that involves a catalogue of books. Part of > the database schema looks like this: > > create table Books(id integer primary key, > title text collate nocase not null, > author

[sqlite] libtclsqlite3 assistance

2015-08-21 Thread jungle Boogie
Hello All, I'm trying to install this on my freebsd system: https://github.com/dbohdan/sqawk Problem is that I compile sqlite from source and keep up to date with trunk pretty regularly, but sqawk can't compile when I also have sqlite complied. Main error from sqawk: errorInfo: couldn't load

[sqlite] Is this a bug ? How to rename a table and all dependencies ?

2015-08-21 Thread John McKown
On Fri, Aug 21, 2015 at 1:02 PM, sqlite-mail wrote: > Thank you for your attention ! > > I'm pointing this here because postgresql do manage this case properly ! > ?And is significantly larger and harder to install. PostgreSQL is not "lite"! I know. I use it and love it. ? > > And I'm

[sqlite] Is this a bug ? How to rename a table and all dependencies ?

2015-08-21 Thread sqlite-mail
Hello ! Here I'm fixing some typos and I also tested on postgresql and there all views are updated properly then I'll say is a bug in sqlite. Does anybody knows how to rename a table and all it's dependencies in one go ? ? The problem: a database has several tables and views that

[sqlite] Is this a bug ? How to rename a table and all dependencies ?

2015-08-21 Thread sqlite-mail
Hello ! Does anybody knows how to rename a table and all it's dependencies in one go ? ? The problem: a database has several tables and views that reference/use other tables something simplified like this: CREATE TABLE a(id integer primary key, name text); CREATE TABLE

[sqlite] Is this a bug ? How to rename a table and all dependencies ?

2015-08-21 Thread Richard Hipp
On 8/21/15, sqlite-mail wrote: > Then do you think this is a bug ? The word "bug" means it gets the wrong answer. The absence of a feature is not a bug, unless that feature is a required part of the specification for the program. The ability to rename tables and all dependencies is not a

[sqlite] Is this a bug ? How to rename a table and all dependencies ?

2015-08-21 Thread Scott Hess
On Fri, Aug 21, 2015 at 1:02 PM, Simon Slavin wrote: > On 21 Aug 2015, at 8:13pm, Scott Hess wrote: > > Since renameTriggerFunc() > > follows renameParentFunc(), my guess is that triggers are also handled. > > The documentation says that statements within TRIGGERs are not changed > correctly: >

[sqlite] Is this a bug ? How to rename a table and all dependencies ?

2015-08-21 Thread Scott Hess
On Fri, Aug 21, 2015 at 11:06 AM, Simon Slavin wrote: > On 21 Aug 2015, at 7:02pm, sqlite-mail wrote: > > I'm pointing this here because postgresql do manage this case properly ! > > If you want postgres, you know where to find it. > > Please don't forget that SQLite has to run on your

[sqlite] Is this a bug ? How to rename a table and all dependencies ?

2015-08-21 Thread Scott Doctor
(oops glitched my send) Try using a database modeling program such as TMS Software's Data Modeler or SQL Maestro Group's SQLite Maestro These handle the changes nicely. You use the programs for designing your databases, queries, views and such. It spits out SQL to run on your system that

[sqlite] Is this a bug ? How to rename a table and all dependencies ?

2015-08-21 Thread Scott Doctor
Scott Doctor scott at scottdoctor.com -- On 8/21/2015 10:37 AM, sqlite-mail wrote: > Thanks for your attention! > > Only to remark on this I tested on postgresql and somehow it knows how deal > with it ! "so few (none?)" > > Cheers ! > > >> Fri Aug 21 2015

[sqlite] When sqlite3_close() returns SQL_BUSY

2015-08-21 Thread R.Smith
Hi Jeff, On 2015-08-21 07:30 AM, Jeff M wrote: > Sometimes my iOS app creates an unreasonable number of prepared statements > (perhaps 1,000, an app bug that I'm fixing). These prepared statements are > later finalized just prior to doing sqlite3_close(), which sometimes returns > SQL_BUSY.

[sqlite] Compile warnings

2015-08-21 Thread Bernhard Schommer
You are right that the warning is wrong in the case that both are zero, I'm not sure if this is still the case in newer gcc versions since I only tried 4.8.*. I'm okay with keeping my local patch to disable the warning in my case and I can fully understand that adding a not necessary test to

[sqlite] Is this a bug ? How to rename a table and all dependencies ?

2015-08-21 Thread J Decker
On Fri, Aug 21, 2015 at 10:04 AM, sqlite-mail wrote: > Then do you think this is a bug ? >> Fri Aug 21 2015 18:57:33 CEST from "Simon Slavin" >>Subject: Re: [sqlite] Is this a bug ? How to rename a table and all >>dependencies ? while it may be considered a nice thing; it's not common practice

[sqlite] Compile warnings

2015-08-21 Thread David Bennett
Addressing only standards compliance, the C99 (n1256) standard says as follows. 7.21.1 /2 Where an argument declared as size_t n specifies the length of the array for a function, n can have the value zero on a call to that function. Unless explicitly stated otherwise in the description of a

[sqlite] Compile warnings

2015-08-21 Thread Scott Robison
And C89 doesn't have the valid pointer requirement On Aug 21, 2015 7:03 AM, "David Bennett" wrote: > Addressing only standards compliance, the C99 (n1256) standard says as > follows. > > 7.21.1 /2 > Where an argument declared as size_t n specifies the length of the array > for > a > function, n

[sqlite] design problem involving trigger

2015-08-21 Thread Scott Robison
Another consideration: it is possible that two different anonymous books are indeed different books. It is also possible a given "author" releases a new rewritten book with the same name. I'm thinking of the Hardy Boys series in particular from my personal experience. Not a big deal, but thought

[sqlite] design problem involving trigger

2015-08-21 Thread Stephen Chrzanowski
Another option would be to not use NULL but use an empty string. On Fri, Aug 21, 2015 at 9:17 AM, R.Smith wrote: > > > On 2015-08-21 04:47 AM, Will Parsons wrote: > >> I'm working on a program that involves a catalogue of books. Part of >> the database schema looks like this: >> >> create

[sqlite] Is this a bug ? Pragmas do not accept qualified names !

2015-08-21 Thread Scott Hess
I think you wanted: PRAGMA attached_db.table_info(one_table); -scott On Fri, Aug 21, 2015 at 7:35 AM, sqlite-mail wrote: > Hello ! > > Today I'm working with sqlite3 with attached databases and when I tried to > get info about a tbale using "PRAGMA TABLE_INFO" I discovered that pragmas > do

[sqlite] design problem involving trigger

2015-08-21 Thread Will Parsons
I'm working on a program that involves a catalogue of books. Part of the database schema looks like this: create table Books(id integer primary key, title text collate nocase not null, author references Authors(id), ...

[sqlite] DbFunctions.TruncateTime

2015-08-21 Thread Steffen Mangold
Hi, how can I trunc time in EntityFramework? I tried it this way: model.Datas .GroupBy(d => DbFunctions.TruncateTime(d.TimeStamp)) .Select(d => d.Key.Value) .ToArray(); But get this error:

[sqlite] When sqlite3_close() returns SQL_BUSY

2015-08-21 Thread Jeff M
Sometimes my iOS app creates an unreasonable number of prepared statements (perhaps 1,000, an app bug that I'm fixing). These prepared statements are later finalized just prior to doing sqlite3_close(), which sometimes returns SQL_BUSY. The docs say SQL_BUSY will be returned if I haven't