Ticket #2676 (closed enhancement: fixed)
SPIT plugin - serial datatype instead of integer on primary key column
| Reported by: | imincik1 | Owned by: | timlinux |
|---|---|---|---|
| Priority: | major: does not work as expected | Milestone: | Version 1.5.0 |
| Component: | C++ Plugins | Version: | Trunk |
| Keywords: | spit | Cc: | ivan.mincik@… |
| Platform Version: | Platform: | All | |
| Must Fix for Release: | No | Awaiting user input: | no |
Description
When exporting ESRI SHP to PostGIS using SPIT plugin, resulting PostGIS table is created with 'integer' data type on PRIMARY KEY column (gid) instead usual 'serial' data type. Such created table is not usable for clients expecting auto increment value on 'gid' column and it also differs from standard shp2pgsql tool.
Example: 1. Table created by SPIT: gid integer, foo character varying, the_geom geometry
2. Expected table structure: gid serial, foo character varying, the_geom geometry
Both of these cases are working well in QGIS. If there is no serious reason for 'integer', I would suggest switching to 'serial' data type.
Looking to source code, we need to: 1. change 'integer' to 'serial' in table creation statement. 2. change data INSERT statements to not include 'gid' column value.