pramsey / pgsql-ogr-fdw

PostgreSQL foreign data wrapper for OGR
MIT License
237 stars 34 forks source link

Floating point fields are imported as real/float instead of double precision #159

Closed jipeream closed 5 years ago

jipeream commented 5 years ago

When importing a MS Access database with UTM lat lon fields, there is a significant lack of precision, as I need centimeter resolution.

IMPORT FOREIGN SCHEMA ogr_all FROM SERVER foreign_server INTO foreign_schema;

As a workaround, I import each table individually, but there are many tables and this is a huge work:

CREATE FOREIGN TABLE foreign_schema.cells ( cel_origin_x DOUBLE PRECISION, cel_origin_y DOUBLE PRECISION, ......... ) SERVER foreign_server OPTIONS (layer 'cells');

I found this so I suspect this issue affects not only to MS Access databases:

ogr_fdw_common.c: 102 case OFTReal: 103 return "real";

Maybe changing these lines would be enough, I'll try this by myself