Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPIT plugin - serial datatype instead of integer on primary key column #12736

Closed
qgib opened this issue Apr 23, 2010 · 1 comment
Closed

SPIT plugin - serial datatype instead of integer on primary key column #12736

qgib opened this issue Apr 23, 2010 · 1 comment

Comments

@qgib
Copy link
Contributor

qgib commented Apr 23, 2010

Author Name: Ivan Mincik (Ivan Mincik)
Original Redmine Issue: 2676

Redmine category:c++_plugins
Assignee: Tim Sutton


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.
@qgib
Copy link
Contributor Author

qgib commented Apr 23, 2010

Author Name: Jürgen Fischer (@jef-n)


implemented in e0ec67b (SVN r13360).


  • resolution was changed from to fixed
  • status_id was changed from Open to Closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant