Bug report #10600

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

Added by Sandro Santilli over 10 years ago. Updated over 7 years 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 Copied to github as #:19005

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, 2016-01-19 03:27 AM


Related issues

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

Associated revisions

Revision da372c8d
Added by Sandro Santilli almost 9 years ago

Ensure "dbname" is always set in the uri

Fixes #10600

Revision 13e39da0
Added by Sandro Santilli over 7 years ago

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

Fixes #16625 (ref #10600)

Revision d1e8903c
Added by Sandro Santilli over 7 years ago

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

Fixes #16625 (ref #10600)

Revision 3efee437
Added by Sandro Santilli over 7 years 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 almost 10 years ago

This is still an issue in master (pre 2.8.0)

#2 Updated by Sandro Santilli almost 9 years 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 almost 9 years ago

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

#4 Updated by Sandro Santilli almost 9 years ago

  • Status changed from In Progress to Closed

#5 Updated by Jürgen Fischer almost 9 years ago

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

#6 Updated by Sandro Santilli almost 9 years ago

Yes, GDAL complained at least a dbname was needed.

#7 Updated by Sandro Santilli almost 9 years ago

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

#8 Updated by Sandro Santilli almost 9 years 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 almost 9 years 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 almost 9 years 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 almost 9 years 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 over 7 years ago

  • Description updated (diff)

This regressed (see #16625)

#13 Updated by Sandro Santilli over 7 years ago

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

Also available in: Atom PDF