pramsey / pgsql-ogr-fdw

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

Ability to execute arbitrary ogr_sql or sql #192

Closed robe2 closed 4 years ago

robe2 commented 4 years ago

I just noticed one of the new features of oracle_fdw is

Add a function oracle_execute to execute arbitrary SQL statements on Oracle. The statements must not return a result (e.g. DDL statements).

I'm thinking we could have something like execute_ogr_sql and execute_sql. The execute_sql would only work for some sources and would pass the sql raw to the underlying ogr connection without any preprocessing.

I only dreamt that such a thing would be possible in an fdw it's one of the things I miss so badly about SQL Server linked server implementation though SQL Server linked server does allow you to have it return a result. But one step at a time.

If you think this is not overstepping what ogr_fdw is slated to do, I'd be happy to push forward to see the effort involved and try to do it myself.

And no I don't want to work on dblink.

Thanks, Your pal Regina

pramsey commented 4 years ago

Yeah, no. Sending arbitrary DDL is not on the agenda. It's not really contemplated in the OGR API, which is where I try to draw my boundary.