GDALGetOutputDriversForDatasetName: Handle driver name prefixes
Feature description
I would have expected the following to either fail or create a table in the default Postgres database:
ogr2ogr PG av_lv95.gpkg resf
Instead, it creates a directory called PG and a shapefile within that directory. To get the desired behavior I had to do
ogr2ogr "PG:" av_lv95.gpkg resf
I'm not sure what the best behavior is, but I think the first command I tried should either fail, warn on ambiguity, or magically do what I wanted :)
Additional context
No response
but I think the first command I tried should either fail, warn on ambiguity, or magically do what I wanted :)
I agree that might be surprising, but that's the 'expected' behavior. "PG" is not the recognized prefix of the PostgreSQL driver. It is "PG:". If we'd want to change that, then we shouldn't automatically select shapefile when there's no .dbf/.shp extension in the filename, which might be slightly breaking change
Closing this as won't fix / works as intended