Bug report #16625
DBManager fails to load raster from dbname-less connection
Status: | Closed | ||
---|---|---|---|
Priority: | High | ||
Assignee: | Sandro Santilli | ||
Category: | DB Manager | ||
Affected QGIS version: | 2.18.9 | Regression?: | Yes |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | Yes | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 24525 |
Description
I made a PostGIS connection with no database name, to rely on libpq defaults.
DBManager is capable of using the connection and shows me the available tables, but when attempting to add a raster layer on the map I get an error about the connection being invalid, specifying that "Cannot open GDAL dataset 'PG:..' You must specify at least a db name".
Note that loading a Vector (GEOMETRY) layer or a simple table works just fine.
I guess DBManager could figure out the dbname from the connection and pass it to GDAL, as a fix.
Related issues
Associated revisions
For GDAL sake extract a dbname from the connection
Works around GDAL limitation reported in:
https://trac.osgeo.org/gdal/ticket/6910
For GDAL sake extract a dbname from the connection
Works around GDAL limitation reported in:
https://trac.osgeo.org/gdal/ticket/6910
Add test for DBManager's PostGIS connector and plugin
Only enabled when ENABLE_PGTEST is set
Includes test for dbname-less URI and service-only URI
(ref #10600 ref #16625 ref #16626)
The test connects to the `qgis_test` database, or what the
QGIS_PGTEST_DB variable requests (as per tests/README.md)
A raster table is added to the test postgis setup script,
for use by this new test.
History
#1 Updated by Sandro Santilli over 7 years ago
- Regression? changed from No to Yes
It looks like this regressed after 2.2.0 (see #10600)
#2 Updated by Giovanni Manghi over 7 years ago
- Priority changed from Normal to High
#3 Updated by Sandro Santilli over 7 years ago
- Assignee set to Alessandro Pasotti
Alessandro: I think the regression was introduced by 212b125a2c2eba93f2c8e3b991ea4be4fdc57623
#4 Updated by Sandro Santilli over 7 years ago
- Related to Bug report #10600: db_manager is unable to load rasters from connections with no dbname specified added
#5 Updated by Sandro Santilli over 7 years ago
- Assignee changed from Alessandro Pasotti to Sandro Santilli
I'm looking at it, might be an easy fix (None vs. empty-string)
#6 Updated by Sandro Santilli over 7 years ago
- Pull Request or Patch supplied changed from No to Yes
Pull requests are ready:
for 2.18: https://github.com/qgis/QGIS/pull/4635
for 3.0: https://github.com/qgis/QGIS/issues/4636
#7 Updated by Sandro Santilli over 7 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
Applied in changeset qgis|13e39da074305a1451b9fd57ce4aedaa8be54121.
#8 Updated by Sandro Santilli over 7 years ago
- Status changed from Closed to Open
Reopening as it's pending backport to 2.18 branch (2.18.9 also affected)
#9 Updated by Sandro Santilli over 7 years ago
- Related to Bug report #14436: Failure to connect to postgres database defined as service in DB manager added
#10 Updated by Sandro Santilli over 7 years ago
- Affected QGIS version changed from 2.18.8 to 2.18.9
#11 Updated by Sandro Santilli over 7 years ago
- Status changed from Open to Closed
Applied in changeset qgis|d1e8903cc9800266a307ca1c83dee9d2d244a385.
#12 Updated by Sandro Santilli over 7 years ago
As this might strike again in the future, this comment is to mention the main problem is upstream where GDAL requires a dbname to be written in the datasource:
https://trac.osgeo.org/gdal/ticket/6910