Re: [sqlite] Bug?: unexpected behaviour - alter parent table in a deferred foreign key relationship

2018-11-23 Thread Thomas Kurz
To what I've learned so far, SQlite stores all data "as is" into any column regardless of the column declaration. The affinity only matters upon reading, am I correct? If so, would it be a big deal implementing ALTER TABLE ALTER COLUMN? - Original Message - From: Dan Kennedy To:

[sqlite] Omitted features documentation slightly out of date

2018-11-23 Thread J. King
The documentation page at under ALTER TABLE mentions that RENAME TABLE and ADD COLUMN are supported, but does not mention the new RENAME COLUMN. -- J. King ___ sqlite-users mailing list

Re: [sqlite] Bug?: unexpected behaviour - alter parent table in a deferred foreign key relationship

2018-11-23 Thread Dan Kennedy
On 11/23/2018 10:47 PM, Thomas Kurz wrote: To what I've learned so far, SQlite stores all data "as is" into any column regardless of the column declaration. The affinity only matters upon reading, am I correct? If so, would it be a big deal implementing ALTER TABLE ALTER COLUMN? Affinity

[sqlite] Bug?: unexpected behaviour - alter parent table in a deferred foreign key relationship

2018-11-23 Thread szmate1618
Dear list members, I have the following problem, with which I'd like to request your aid: Currently, at version 3.25.2, SQLite only has a limited support for alter table. E.g. you cannot change the datatype (type affinity) of a column, or drop a column. The usual workaround is to create a new

Re: [sqlite] Bug?: unexpected behaviour - alter parent table in a deferred foreign key relationship

2018-11-23 Thread Dan Kennedy
On 11/23/2018 09:54 PM, szmate1618 wrote: Dear list members, I have the following problem, with which I'd like to request your aid: Currently, at version 3.25.2, SQLite only has a limited support for alter table. E.g. you cannot change the datatype (type affinity) of a column, or drop a

[sqlite] Optimizing aggregation queries

2018-11-23 Thread Wout Mertens
Given a logging table: CREATE TABLE log(type TEXT, amount INTEGER) SELECT type, SUM(amount), COUNT(*) FROM log GROUP BY type What would be good approaches to make the query fast? Wout. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] Bug?: unexpected behaviour - alter parent table in a deferred foreign key relationship

2018-11-23 Thread szmate1618
>"PRAGMA foreign_keys = ?" is a property of the connection only, not the >database file. So what advantage would there be in including the PRAGMA >statements in the body of a transaction? Not much, if I do everything right, I guess. But what if I break the foreign key integrity? If it's inside a

[sqlite] PRIMARY KEY not enforcing NOT NULL, WITHOUT ROWID default - suggestions

2018-11-23 Thread Digital Dog
Hi! Welcome to the list. I'm reading documentation on the topic: "In an elegant system, all tables would behave as WITHOUT ROWID tables even without the WITHOUT ROWID keyword". then "However, NOT NULL was not enforced on PRIMARY KEY columns by early versions of SQLite due to a bug. By the time

Re: [sqlite] Optimizing aggregation queries

2018-11-23 Thread Simon Slavin
On 23 Nov 2018, at 3:44pm, Wout Mertens wrote: > CREATE TABLE log(type TEXT, amount INTEGER) > SELECT type, SUM(amount), COUNT(*) FROM log GROUP BY type > > What would be good approaches to make the query fast? Create an index for "log(type, amount)". Simon.

[sqlite] bug: error in code for geopoly_ccw function

2018-11-23 Thread Graham Hardman
hi, In my posting on 20th November I supplied output from the cli buit from the snapshot that includes the new geopoly function geopoly_ccw. That output showed incorrect results being returned from an attempt to reverse the direction of a polygon in CW mode after a mirror transform of a CCW