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:

  1. Table created by SPIT:

gid integer, foo character varying, the_geom geometry

  1. 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.

Change History (1)

comment:1 by jef, 14 years ago

Resolution: fixed
Status: newclosed

implemented in r13359.

Note: See TracTickets for help on using tickets.