Feature request #2676
SPIT plugin - serial datatype instead of integer on primary key column
Status: | Closed | ||
---|---|---|---|
Priority: | Low | ||
Assignee: | Tim Sutton | ||
Category: | C++ Plugins | ||
Pull Request or Patch supplied: | Resolution: | fixed | |
Easy fix?: | No | Copied to github as #: | 12736 |
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.
History
#1 Updated by Jürgen Fischer over 14 years ago
- Resolution set to fixed
- Status changed from Open to Closed
implemented in e0ec67b2 (SVN r13360).