On February 13, 2019 5:47:09 PM EST, Thomas Kurz wrote:
>I don't think so because this works (shortened here; it also works with
>REFERENCES...):
>
>ALTER TABLE test ADD COLUMN groupid2 INTEGER NOT NULL DEFAULT 1;
You're correct; I must have been confusing the prohibition on CURRENT_TIMESTAMP
>boun...@mailinglists.sqlite.org] On Behalf Of Thomas Kurz
>Sent: Wednesday, 13 February, 2019 15:32
>To: SQLite mailing list
>Subject: [sqlite] inconsistent behavior when creating INTEGER NOT
>NULL column without DEFAULT?
>
>I just stumbled upon the following issue (tested with 3.27.1)
On Wednesday, February 13, 2019, 11:06:07 PM, Thomas Kurz
wrote:
>> I guess a missing DEFAULT automatically implies DEFAULT NULL, so
>> the behavior of ALTER should be correct whilst CREATE seems to
>> forget to reject the statement.
I suspect the difference is you can CREATE a NOT NULL column
> I guess a missing DEFAULT automatically implies DEFAULT NULL, so the behavior
> of ALTER should be correct whilst CREATE seems to forget to reject the
> statement.
Sorry, I was wrong about this. The CREATE shows the correct behavior whereas
ALTER incorrecty rejects the statement. According
> This is a limitation of SQLite's current ALTER TABLE implementation. Columns
> can only be added with a default value of NULL, therefore NOT NULL columns
> are forbidden.
I don't think so because this works (shortened here; it also works with
REFERENCES...):
ALTER TABLE test ADD COLUMN
On February 13, 2019 5:32:09 PM EST, Thomas Kurz wrote:
>I just stumbled upon the following issue (tested with 3.27.1):
>
>I can do this:
>CREATE TABLE test (groupid INTEGER NOT NULL REFERENCES mygroup (id) ON
>UPDATE CASCADE ON DELETE CASCADE);
>
>But this fails:
>ALTER TABLE test ADD COLUMN
I just stumbled upon the following issue (tested with 3.27.1):
I can do this:
CREATE TABLE test (groupid INTEGER NOT NULL REFERENCES mygroup (id) ON UPDATE
CASCADE ON DELETE CASCADE);
But this fails:
ALTER TABLE test ADD COLUMN groupid2 INTEGER NOT NULL REFERENCES mygroup (id)
ON UPDATE
7 matches
Mail list logo