Skip to content

Commit

Permalink
[processing] Allow using libpq defaults for host,port,user,pass and d…
Browse files Browse the repository at this point in the history
…bname

Fixes #15706
  • Loading branch information
strk committed Oct 15, 2016
1 parent 979d619 commit be3e807
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions python/plugins/processing/algs/gdal/ogr2ogrtopostgis.py
Expand Up @@ -202,17 +202,20 @@ def getConsoleCommands(self):
arguments.append('"' + shapeEncoding + '"')
arguments.append('-f')
arguments.append('PostgreSQL')
arguments.append('PG:"host=' + host)
arguments.append('port=' + port)
if len(dbname) > 0:
arguments.append('PG:"')
if host:
arguments.append(' host=' + host)
if port:
arguments.append('port=' + port)
if dbname:
arguments.append('dbname=' + dbname)
if len(password) > 0:
if password:
arguments.append('password=' + password)
if len(schema) > 0:
if schema:
arguments.append('active_schema=' + schema)
else:
arguments.append('active_schema=public')
arguments.append('user=' + user + '"')
if user:
arguments.append('user=' + user)
arguments.append('"')
arguments.append(dimstring)
arguments.append(ogrLayer)
arguments.append(ogrLayerName(inLayer))
Expand Down

0 comments on commit be3e807

Please sign in to comment.