[Gdal-dev] PostGIS varchar fields

Frank Warmerdam warmerdam at pobox.com
Wed Jan 11 22:19:30 EST 2006


On 1/11/06, William Kyngesburye <woklist at kyngchaos.com> wrote:
> I did not use the precision option.  But they are varchars in the
> PostGIS DB - I verified that by browsing the DB with phppgadmin.  I
> thinks that's because I originally created it by importing just the
> geometry with no attributes (I was experimenting),then cleared it,
> then added the attribute fields with SQL commands.  Then I appended
> to the DB with OGR with mif/mid's with full attributes.  So, the
> PostGIS DB does have varchars.  I'd have to scan the DB (large), or
> test on a separate one, to see if any name strings were cut off at 80
> chars (if the fields are already varchar, does -append still cut off
> at 80 chars if the default precision=true is used?).
>
> So, back to the question, is OGR supposed to recognize varchar field
> lengths in postgis?

William,

I think I am confused.  If a field is declared "VARCHAR"
doesn't it have a variable length?  That is certainly
the assumption of the OGR code that builds the OGR
field definitions from a table, which means that when
going to shapefile I have to pick an arbitrary field length
for the .dbf file.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list