[QGIS-trac] [Quantum GIS] #2676: SPIT plugin - serial datatype
instead of integer on primary key column
Quantum GIS
qgis at qgis.org
Sat Apr 24 03:12:04 EDT 2010
#2676: SPIT plugin - serial datatype instead of integer on primary key column
------------------------------------------------+---------------------------
Reporter: imincik1 | Owner: timlinux
Type: enhancement | Status: new
Priority: major: does not work as expected | Milestone: Version 1.5.0
Component: C++ Plugins | Version: HEAD
Keywords: spit | Platform_version:
Platform: All | Must_fix: No
Status_info: 0 |
------------------------------------------------+---------------------------
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.
--
Ticket URL: <https://trac.osgeo.org/qgis/ticket/2676>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats
More information about the QGIS-trac
mailing list