On Jan 23, 2008, at 3:39 AM, Peter Hopfgartner wrote:
we were looking at the tables generated by shp2pgsql. As it seems,
numeric(m, 0) is mapped, if possible to integers, and numeric(m,n)
is mapped to numeric.
Do you mean, mapped to float?
We would like to optionally maintain the numeric length and
precision for our data imports. Looking at shp2pgsql.c, this should
be rather simple. Basically, we could add an option, let's say '-K'
for keep precision, and modify the code around line 550.
This is possible. You need to be aware of the *massive* performance
penalty that comes with using numeric instead of integer/float. As
long as you are clear on that, it's certainly acceptable.
Since we have -i for "force to integer" how about -n for "use numeric
for all numbers"?
A similar change could be done for pgsql2shp, modifying the SQL
query, which gets the type information from PostgreSQL and changing
the code generating the dbf header.
If such a change is welcomed, we can try to have it done soon.
Regards,
Peter Hopfgartner and Sergio Segala
R3 GIS
http://www.r3-gis.com
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users