I have a PostGIS database with a table vector_data
in schema vectors
, and the vectors
schema is listed in the database search_path
. In GDAL <= 3.0.4, this command works fine (that is, the vector_data
table is reachable because it's in the search_path
):
ogr2ogr -f GeoJSON "test.geojson" PG:"host=localhost port=5432 user=username password=password" -sql "SELECT ST_AsGeoJSON(geom) FROM vector_data LIMIT 1;"
However, in GDAL >= 3.1.0, that same command fails as if the search_path
is being ignored:
ERROR 1: ERROR: relation "vector_data" does not exist
LINE 1: ...LCursor CURSOR for SELECT ST_AsGeoJSON(geom) FROM vector_dat...
^
Questions: Why did this ogr2ogr
behavior change, and precisely where (which GitHub issue/PR)?
-lco SCHEMA=your_schema_name
to your commandvector_data
tovectors.vector_data
-lco SCHEMA
. I'm aware that I can specify a schema in the connection string, though, or specify it using dot notation in the query, and those do work. But my question is WHY did the behavior change? Was this intentional within GDAL? Or did GDAL pick up an unintended change in the newerlibpq
driver (version 10 vs 12)? I'm surprised to find a breaking change in a GDAL minor release (3.0.4 to 3.1.0).