Opened 14 years ago
Closed 14 years ago
#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@… |
Must Fix for Release: | No | Platform: | All |
Platform Version: | 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:
- Table created by SPIT:
gid integer, foo character varying, the_geom geometry
- 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:
- change 'integer' to 'serial' in table creation statement.
- change data INSERT statements to not include 'gid' column value.
implemented in r13359.