pramsey / pgsql-ogr-fdw

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

does ogr_fdw not support 'postgresql' format? #123

Closed goodarzi64 closed 7 years ago

goodarzi64 commented 7 years ago

I am trying to create some foreign spatial tables which have been placed in another server (db is postgresql/postgis too). I used ogr_fdw 1.0.2 but strangely encounter with error: _unable to find format "postgresql" HINT: See the formats list at http://www.gdal.org/ogr_formats.html_
I referred to the aforementioned link. there was "postgresql/postgis" format in the list but when I ran ogr_fdw_info, no such format existed. I could not understand why this happen? I have pasted my sql create server command in order to get valuable help.

CREATE SERVER wraparound FOREIGN DATA WRAPPER ogr_fdw OPTIONS ( datasource 'pg:dbname=test port=5432 host=192.168.220.145 user=bbb password=ttt' , format 'postgresql');

robe2 commented 7 years ago

Your GDAL needs to be compiled with PostgreSQL (against libpq) for it to support PostgreSQL/PostGIS. I suspect your GDAL is not. How did you get / build your GDAL library?

For example on Windows I don't build with libpq intentionally so I don't have to worry about distributing a libpq library or the existing one being incompatible.

As far as ogr_fdw goes, building against PostgreSQL is not very useful since you are much better off using the pgql_fdw for PostgreSQL / PostgreSQL connections - it has useful features like expression push down that ogr_fdw lacks.