Feature request #15071
Create table dialog (SpatiaLite) misses data type 'Serial'
|Pull Request or Patch supplied:||No||Resolution:|
|Easy fix?:||No||Copied to github as #:||23014|
In the 'DB Manager' the create table dialog misses data type 'Serial' for SpatiaLite connections.
#1 Updated by Jukka Rahkonen over 5 years ago
SQLite does not have datatype "serial". INTEGER PRIMARY KEY [AUTOINCREMENT] comes closest to that. No other column than the primary key one can be autoincremented.
For my mind this is not a bug in QGIS.
#2 Updated by R. R. over 5 years ago
I've just noticed that for new SpatiaLite tables an auto incrementing primary key (data type 'integer') is created automatically. For new PostGIS tables users have to set the data type to 'serial'. So this is neither a bug nor a missing feature, just the interface is a bit confusing. Feel free to close this ticket.
#3 Updated by Jukka Rahkonen over 5 years ago
PostgreSQL/PostGIS and SQLite/SpatiaLite are rather alike but they are not at all identical.
In SQLite there is no choice in this case because "column INTEGER PRIMARY KEY" takes the values automatically from the same place as the ROWID. In PostgreSQL it is possible and valid to have PK in integer column which does not take values from a sequence.