pramsey / pgsql-ogr-fdw

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

PostgreSQL not supported as a FDW #202

Closed bowguy closed 3 years ago

bowguy commented 3 years ago

Using the example in the documentation, I tried:

CREATE SERVER wraparound FOREIGN DATA WRAPPER ogr_fdw OPTIONS ( datasource 'PG:dbname=foo user=postgres', format 'PostgreSQL' );

but it returned:

ERROR: unable to find format "PostgreSQL" HINT: See the formats list at http://www.gdal.org/ogr_formats.html SQL state: HV00N

Then tried:

select * from ogr_fdw_drivers()

But PostgreSQL is not in the list.

PG 12, Windows 10, ogr_fdw_version():

OGR_FDW="1.1" GDAL="2.4.4"

Thanks

pramsey commented 3 years ago

Check your ogrinfo. This is a GDAL problem, not a ogr_fdw problem. Your GDAL just probably doesn't have pg support built.

bowguy commented 3 years ago

Thanks @robe2 is postgresql support not included in the windows build of GDAL for PostGIS?

robe2 commented 3 years ago

Just for future reference for anyone who looks at this ticket. The OGR_FDW driver packaged in PostGIS windows bundle does not include PostgreSQL support. This is intentional to prevent any possible conflict with the libpq.dll distributed by EDB which I can't control.

That said -- for PostGIS / PostGIS connection postgres_fdw is a much better option than ogr_fdw since postgres_fdw push down for joins, filters, and aggregates is much better than can be ever provided via GDAL/OGR_FDW.

pramsey commented 3 years ago

Good advice all around 👍