pramsey / pgsql-ogr-fdw

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

"ogr_fdw" and changes on sources files #225

Closed pedrogeo closed 2 years ago

pedrogeo commented 2 years ago

Hi,

I would like to know if it is possible that "ogr_fdw" can detect changes on the structure of a shapefile (or any other compatible format) ? Ex : if a column of a shapefile, which is referenced by "ogr_fdw", is deleted outside "ogr_fdw" (by a user in Qgis).

After a test, I notice that this column is always in the foreign table in Postgresql after the delete outside "ogr_fdw".

Is there a way to update the structure of the foreign table or that "ogr_fdw" automatically detect and consider the change(s) ?

Pierre

pramsey commented 2 years ago

Nope, this is one of the drawbacks of FDW as an access mechanism. The schema is fixed. This is a general limitation/benefit of life in the database. Like an ogr_query(datasource, filter) function that just ran and returns a recordset would be pretty awesome and flexible, except to work it would need some kind of schema information about the output records. There's some examples of functions like (for example json_to_record) and they all require a bit of a priori schema knowledge, it's just a question of when you express that knowledge.

pedrogeo commented 2 years ago

Thanks for your feedback.