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 authored and alexbruy committed Oct 18, 2016
1 parent b83fbb1 commit d63222e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions python/plugins/processing/algs/gdal/ogr2ogrtopostgis.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,17 +203,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 d63222e

Please sign in to comment.