Skip to content

Commit

Permalink
Ensure "dbname" is always set in the uri
Browse files Browse the repository at this point in the history
Fixes #10600
  • Loading branch information
Sandro Santilli committed Jan 19, 2016
1 parent 26ae323 commit da372c8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/plugins/db_manager/db_plugins/postgis/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down

0 comments on commit da372c8

Please sign in to comment.