Skip to content
Permalink
Browse files

Ensure "dbname" is always set in the uri

Fixes #10600
  • Loading branch information
Sandro Santilli
Sandro Santilli committed Jan 19, 2016
1 parent 26ae323 commit da372c8d40b1f81eb2fc307edc77199ba540bf10
Showing with 3 additions and 0 deletions.
  1. +3 −0 python/plugins/db_manager/db_plugins/postgis/connector.py
@@ -51,6 +51,9 @@ def __init__(self, uri):
username = uri.username() or os.environ.get('PGUSER') or os.environ.get('USER')
password = uri.password() or os.environ.get('PGPASSWORD')

self.dbname = uri.database() or os.environ.get('PGDATABASE') or username
uri.setDatabase(self.dbname)

expandedConnInfo = self._connectionInfo()
try:
self.connection = psycopg2.connect(expandedConnInfo.encode('utf-8'))

0 comments on commit da372c8

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