gdal_only_dbname.patch
python/plugins/db_manager/db_plugins/postgis/connector.py | ||
---|---|---|
51 | 51 |
username = uri.username() or os.environ.get('PGUSER') or os.environ.get('USER') |
52 | 52 |
password = uri.password() or os.environ.get('PGPASSWORD') |
53 | 53 | |
54 |
self.dbname = uri.database() or os.environ.get('PGDATABASE') or username |
|
55 |
uri.setDatabase(self.dbname) |
|
54 |
#self.dbname = uri.database() or os.environ.get('PGDATABASE') or username
|
|
55 |
#uri.setDatabase(self.dbname)
|
|
56 | 56 | |
57 | 57 |
expandedConnInfo = self._connectionInfo() |
58 | 58 |
try: |
python/plugins/db_manager/db_plugins/postgis/plugin.py | ||
---|---|---|
30 | 30 |
from ..plugin import ConnectionError, InvalidDataException, DBPlugin, Database, Schema, Table, VectorTable, RasterTable, \ |
31 | 31 |
TableField, TableConstraint, TableIndex, TableTrigger, TableRule |
32 | 32 | |
33 |
import os |
|
34 | ||
33 | 35 |
try: |
34 | 36 |
from . import resources_rc |
35 | 37 |
except ImportError: |
... | ... | |
262 | 264 |
if not uri: |
263 | 265 |
uri = self.database().uri() |
264 | 266 |
schema = (u'schema=%s' % self.schemaName()) if self.schemaName() else '' |
265 |
dbname = (u'dbname=%s' % uri.database()) if uri.database() else '' |
|
267 | ||
266 | 268 |
host = (u'host=%s' % uri.host()) if uri.host() else '' |
267 |
user = (u'user=%s' % uri.username()) if uri.username() else '' |
|
268 | 269 |
passw = (u'password=%s' % uri.password()) if uri.password() else '' |
269 | 270 |
port = (u'port=%s' % uri.port()) if uri.port() else '' |
270 | 271 | |
272 |
user = uri.username() or os.environ.get('PGUSER') or os.environ.get('USER') |
|
273 |
dbname = uri.database() or os.environ.get('PGDATABASE') or user |
|
274 | ||
275 |
user = (u'user=%s' % user) if user else '' |
|
276 |
dbname = (u'dbname=%s' % dbname) if dbname else '' |
|
277 | ||
271 | 278 |
# Find first raster field |
272 | 279 |
col = '' |
273 | 280 |
for fld in self.fields(): |