Feature request #15071

Create table dialog (SpatiaLite) misses data type 'Serial'

Added by R. R. over 8 years ago. Updated over 8 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:DB Manager
Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:23014

Description

In the 'DB Manager' the create table dialog misses data type 'Serial' for SpatiaLite connections.

db_manager_create_table_spatialite.png (62.3 KB) R. R., 2016-06-18 04:05 PM


Related issues

Related to QGIS Application - Bug report #15079: New PostGIS/SpatiaLite table - Inconsistent behavior of ... Closed 2016-06-19

Associated revisions

Revision 318a8350
Added by Matthias Kuhn over 8 years ago

Default to creating an autoincrement primary key for spatialite

References #15071 (https://hub.qgis.org/issues/15071)

History

#1 Updated by Jukka Rahkonen over 8 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.

http://www.sqlite.com/datatype3.html
http://www.sqlite.com/lang_createtable.html#rowid
https://sqlite.org/autoinc.html

For my mind this is not a bug in QGIS.

#2 Updated by R. R. over 8 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 8 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.

#4 Updated by Matthias Kuhn over 8 years ago

  • Status changed from Open to Closed

If you have any idea how to improve the confusing interface, please open a new issue.

#5 Updated by R. R. over 8 years ago

Most likely this is not an issue of high priority. However, here is my proposal to fix it: #15079-2

#6 Updated by Jürgen Fischer over 7 years ago

  • Related to Bug report #15079: New PostGIS/SpatiaLite table - Inconsistent behavior of primary keys added

Also available in: Atom PDF