[postgis-devel] Patch: preserve scale and precision when in pgsql2shp

Sandro Santilli strk at keybit.net
Mon Jul 21 08:09:24 PDT 2014


On Mon, Jul 21, 2014 at 04:51:27PM +0200, Peter Hopfgartner wrote:
> Hi
> 
> This patch uses the precision and scale information from the
> database server in order to write the shape file. The advantage is
> twofold: a major control on the shape file format and less disk
> space used when writing DECIMALs/NUMERICs which have a precision of
> less then 32 digits.
> 
> The topic was in some way discussed in http://postgis.17.x6.nabble.com/Maintain-length-and-precision-for-numneric-fields-in-pgsql2shp-and-shp2pgsql-td3548722.html.
> 
> The  patch is against branch 1.5. If the approach is ok, I can
> prepare a patch for trunk.

Could you please include a testcase to go with the patch ?

I'm not sure how it would look as if I recall correctly all current
dumper tests are "round-trip" tests that start with loading, and
are likely not checking the DBF at all. Maybe it would come as
an extension to the run_test.pl script.

Probably best to file a ticket on trac to deal with this, attaching
this patch for a start: http://trac.osgeo.org/postgis/newticket

--strk;



More information about the postgis-devel mailing list