[postgis-devel] dbf attributes size
strk at refractions.net
strk at refractions.net
Mon Oct 24 03:57:14 PDT 2005
Hello there, I'm taking a look at shp2pgsql and pgsql2shp
trying to make numerical attribute size handling stricter.
Currently, the loader uses this conservative/pessimistic mapping:
DBF_SIZE SQL_TYPE
0-9 int4
10-18 int8
19-x numeric(size,0)
And the dumper uses a size of 16 of dbf attributes of any sql integer type:
SQL_TYPE DBF_SIZE
int2 16
int4 16
int8 16
For what I can tell the correct mapping between integer DBF attributes
and sql types should be as follows:
DBF_SIZE SQL_TYPE LONGEST_TEXT_REP
0-6 int2 -32768
7-11 int4 -2147483648
12-20 int8 -9223372036854775808
21-x numeric(size,0)
Does anyone see any drawback in implementing this mapping ?
--strk;
More information about the postgis-devel
mailing list