Opened 11 years ago
Closed 7 years ago
#2761 closed defect (worksforme)
Pgsql2shp changes type int32 to real
Reported by: | javagc | Owned by: | pramsey |
---|---|---|---|
Priority: | high | Milestone: | PostGIS PostgreSQL |
Component: | postgis | Version: | 2.1.x |
Keywords: | Cc: |
Description
There is a bug when executing pgsql2shp to export shape-file from a table. pgsql2shp creates .dbf file where the table and it's columns are described, if any column has type int32 it converts them to Real, what is wrong and causes loss of some data. I need to mention that it only happens with int32 (for example if type is short int that the pgsql2shp acts correctly)
Change History (3)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
I have a column of type Integer in my table. When I use pgsql2shp it converts the Integer into real and writes real in the DBF. Later When I import this data with shp2pgsql tool I get numeric instead of Integer for the column mentioned above
comment:3 by , 7 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
More information required. There is no "int32" type in PgSQL (eg: create table test (i int32)). Checking the source code, there are mappings to "integer-like" types in DBF for int2, int4, and int8. It's possible you have a numeric column, that's getting mapped to a "float-like" DBF type (which is not necessarily wrong), but I'm only guessing in absence of more precise info.