Bug report #10600

db_manager is unable to load rasters from connections with no dbname specified

Added by Sandro Santilli over 3 years ago. Updated 4 months ago.

Status:Closed
Priority:Normal
Assignee:Sandro Santilli
Category:DB Manager
Affected QGIS version:2.2.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No

Description

When a database name is not specified in a postgis connection string, relying on libpq default, the loading of postgis raster tables fails.

See also #9037

gdal_only_dbname.patch Magnifier (2.28 KB) Sandro Santilli, 01/19/2016 03:27 AM


Related issues

Related to QGIS Application - Bug report #16625: DBManager fails to load raster from dbname-less connection Closed 05/26/2017

Associated revisions

Revision da372c8d
Added by Sandro Santilli over 1 year ago

Ensure "dbname" is always set in the uri

Fixes #10600

Revision 13e39da0
Added by Sandro Santilli 4 months ago

Ensure "dbname" is set in the uri, once again

Fixes #16625 (ref #10600)

Revision d1e8903c
Added by Sandro Santilli 4 months ago

Ensure "dbname" is set in the uri, once again

Fixes #16625 (ref #10600)

Revision 3efee437
Added by Sandro Santilli 4 months ago

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 2 years ago

This is still an issue in master (pre 2.8.0)

#2 Updated by Sandro Santilli over 1 year ago

  • Status changed from Open to In Progress
  • Target version set to Version 2.14

still an issue in current master (2.14-pre)

#3 Updated by Sandro Santilli over 1 year ago

It turns out this was broken by 62b2c1fcabc88e82b0229790b56a7a9ada0f5771 to fix #11886

#4 Updated by Sandro Santilli over 1 year ago

  • Status changed from In Progress to Closed

#5 Updated by Jürgen Fischer over 1 year ago

Is the requirement to have a dbname when loading a raster layer the problem?

#6 Updated by Sandro Santilli over 1 year ago

Yes, GDAL complained at least a dbname was needed.

#7 Updated by Sandro Santilli over 1 year ago

I guess a ticket could also be filed against GDAL to request allowing that, btw

#8 Updated by Sandro Santilli over 1 year ago

  • Status changed from Closed to Reopened

Upstream filed: https://trac.osgeo.org/gdal/ticket/6316

I'm reopening this to try another approach, less intrusive

#9 Updated by Sandro Santilli over 1 year ago

I have another patch that only adds the "dbname" in the URI of raster layers, rather than in all postgresql layers.
Is it to be preferred leaving dbname undefined in the project file, when it was in the connection configuration ?

#10 Updated by Sandro Santilli over 1 year ago

I shall note that "host" and "port" are still being enforced in the URI (from before my first patch)

#11 Updated by Sandro Santilli over 1 year ago

  • Resolution set to fixed/implemented
  • File gdal_only_dbname.patchMagnifier added
  • Status changed from Reopened to Closed

Well, I'll leave master as it is. After all that's how it behaved before 62b2c1fcabc88e82b0229790b56a7a9ada0f5771 which was meant to fix another issue (username/password in project file).

The patch to restrict the scope of enforcing a "dbname" component is attached to this ticket, in case there are other views and a discussion should follow.

#12 Updated by Sandro Santilli 4 months ago

  • Description updated (diff)

This regressed (see #16625)

#13 Updated by Sandro Santilli 4 months ago

  • Related to Bug report #16625: DBManager fails to load raster from dbname-less connection added

Also available in: Atom PDF