[Gdal-dev] PostGIS varchar fields

William Kyngesburye woklist at kyngchaos.com
Tue Jan 10 19:46:35 EST 2006


I'm not sure if it's supposed to work this way or not:  I extracted  
an area out of a big PostGIS database, to shapefile, and all the  
varchar fields from PostGIS became character fields of length 80.  So  
all those 2-8 varchar fields in the attributes balloon the dbf, and  
the few 200 char name fields get chopped off.

ogrinfo -al -so on the PostGIS DB returns "String (0.0)" for the  
field type for all varchar fields, but the correct length for all  
fixed char fields (a few 1 and 2-char fields).  The original mif/mid  
source I used to create the PostGIS DB with ogr2ogr returns the  
correct length for all char fields.  A direct ogr2ogr from the mif/ 
mid to shapefile also creates the correct field lengths in the  
shapefile, although the integer fields get changed to reals.

GDAL 1.3.1 with Postgres 8.0.4 libs on client end, Postgres 8.0.4 +  
PostGIS 1.0.6 on PG server.

-----
William Kyngesburye <kyngchaos at kyngchaos.com>
http://www.kyngchaos.com/

"Time is an illusion - lunchtime doubly so."

- Ford Prefect




More information about the Gdal-dev mailing list