I think it's because you can just use CREATE UNIQUE INDEX, which conveniently 
also lets you DROP INDEX on it if you want to get rid of the unique constraint 
later.

When you put UNIQUE in the original table description it gets a 
sqlite_autoindex_blah name, and you can't ALTER or DROP it from there as you 
mentioned.


-----Original Message-----
From: sqlite-users [mailto:[email protected]] On 
Behalf Of Mark Wagner
Sent: Monday, February 11, 2019 11:16 PM
To: SQLite mailing list
Subject: [sqlite] why no unique columns on alter table

This is mainly for my curiosity.   Is there any particular reason that one
can't add a unique column on an alter table?  With a default value of null
they would all have unique values by default.

Any insight into this would be great.  Perhaps there' something obvious I'm
missing.

-- Mark
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to