Skip to content
Permalink
Browse files

Allow loading PostGIS Rasters from partially configured connections

Partially configured connection are those for which an hostname
or username or port etc. are not specified, relying on libpq defaults.

It was already fixed for geometries but rasters needed more love.
See #9037.
  • Loading branch information
Sandro Santilli
Sandro Santilli committed Sep 4, 2014
1 parent f14ad55 commit e91141cb2a60eace7057e3528bbb9a0fdc4dee30
Showing with 7 additions and 1 deletion.
  1. +7 −1 python/plugins/db_manager/db_plugins/postgis/plugin.py
@@ -278,7 +278,13 @@ def info(self):
def gdalUri(self):
uri = self.database().uri()
schema = ( u'schema=%s' % self.schemaName() ) if self.schemaName() else ''
gdalUri = u'PG: dbname=%s host=%s user=%s password=%s port=%s mode=2 %s table=%s' % (uri.database(), uri.host(), uri.username(), uri.password(), uri.port(), schema, self.name)
dbname = ( u'dbname=%s' % uri.database() ) if uri.database() else ''
host = ( u'host=%s' % uri.host() ) if uri.host() else ''
user = ( u'user=%s' % uri.username() ) if uri.username() else ''
passw = ( u'password=%s' % uri.password() ) if uri.password() else ''
port = ( u'port=%s' % uri.port() ) if uri.port() else ''
gdalUri = u'PG: %s %s %s %s %s mode=2 %s table=%s' % \
(dbname, host, user, passw, port, schema, self.name)
return gdalUri

def mimeUri(self):

0 comments on commit e91141c

Please sign in to comment.
You can’t perform that action at this time.