[Qgis-user] 0.11 postgis export to shapefile problem

Bernhard Ströbl bernhard.stroebl at jena.de
Thu Dec 4 06:04:25 PST 2008


Dear Matt,

When you import into PostGIS using spit, spit creates a primary key 
field for you, with the default name "gid".

I assume the following: Your original PostGIS table has a field "gid" as 
  its primary key (PK). Thus this field gets exported to shp as all the 
other fields. When you reimport, spit - again - creates a primary key 
field with the default name gid. This causes the duplicate field name.

How to avoid:
either delete "gid" in the dbf-file prior to reimport or reimport using 
a different name for the primary key field, the import dialog features a 
text input field defaulting to "gid" for this purpose.

hope this helps

Benno

Matt B:
> I get the following strange behaviour when I create a postgis vector
> (polygon) and export/reimport to a shapefile and back into postgis.
> 1 create postgis vector table.
> 2 export to shapefile
> 3 reimport usiing spit back into a different pc running postigs
> error:
> The following fields are duplicates : gid
> 
> somewhat annoying and I've discovered that removing the gid field causes
> issues. Running postgresql 8.3 and metis on ubuntu 8.10.
> 
> Thanks
> Matt
> 
> 
> ________ Information from NOD32 ________
> This message was checked by NOD32 Antivirus System for Linux Mail Server.
> http://www.nod32.com
> 
> 
> 
> ------------------------------------------------------------------------
> 


________ Information from NOD32 ________
This message was checked by NOD32 Antivirus System for Linux Mail Server.
http://www.nod32.com



More information about the Qgis-user mailing list