Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
qgib opened this issue Jun 18, 2016 · 6 comments
Closed

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

qgib opened this issue Jun 18, 2016 · 6 comments
Labels
DB Manager Relating to the DB Manager core plugin Feature Request

Comments

@qgib
Copy link
Contributor

qgib commented Jun 18, 2016

Author Name: Reinhard Reiterer (Reinhard Reiterer)
Original Redmine Issue: 15071

Redmine category:db_manager


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



Related issue(s): #23021 (relates)
Redmine related issue(s): 15079


@qgib
Copy link
Contributor Author

qgib commented Jun 19, 2016

Author Name: Jukka Rahkonen (Jukka Rahkonen)


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.

@qgib
Copy link
Contributor Author

qgib commented Jun 19, 2016

Author Name: Reinhard Reiterer (Reinhard Reiterer)


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.

@qgib
Copy link
Contributor Author

qgib commented Jun 20, 2016

Author Name: Jukka Rahkonen (Jukka Rahkonen)


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.

@qgib
Copy link
Contributor Author

qgib commented Jun 21, 2016

Author Name: Matthias Kuhn (@m-kuhn)


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


  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented Jun 21, 2016

Author Name: Reinhard Reiterer (Reinhard Reiterer)


Most likely this is not an issue of high priority. However, here is my proposal to fix it: #23021 (comment)

@qgib
Copy link
Contributor Author

qgib commented May 19, 2017

Author Name: Jürgen Fischer (@jef-n)


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DB Manager Relating to the DB Manager core plugin Feature Request
Projects
None yet
Development

No branches or pull requests

1 participant