pramsey / pgsql-ogr-fdw

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

Support for Layer Creation Options #169

Closed robe2 closed 5 years ago

robe2 commented 5 years ago

I'm assuming layer creation options are not supported either that or I'm missing something.

trying to simulate the equivalent of this command: ogr2ogr -f "PostgreSQL" PG:"dbname=postgis_in_action" arc.osm -lco COLUMN_TYPES="other_tags=hstore" Which results in bringing in the other_tags column in as hstore instead of string.

Right now I just do other_tags::hstore, but would be nice if I didn't have to.

If there is a way right now I'd like to know about it. If not it's low priority.

I should add I tried stuffing these in open_options and config_options by first trying to do a -lco, but that failed, and then just putting in the config - which did nothing in the CREATE SERVER command

CREATE SERVER svr_osm FOREIGN DATA WRAPPER ogr_fdw OPTIONS ( datasource '/data/arc.osm', format 'OSM', open_options 'COLUMN_TYPES="other_tags=hstore"' ); IMPORT FOREIGN SCHEMA ogr_all FROM SERVER svr_osm INTO staging

pramsey commented 5 years ago

Layer creation refers to creation on the OGR side, not on the PgSQL side, so there's no real way to do that. Keep on casting.