Skip to content
Permalink
Browse files

[processing] Allow using libpq defaults for host,port,user,pass and d…

…bname

Fixes #15706
  • Loading branch information
strk committed Oct 15, 2016
1 parent 979d619 commit be3e807d0f0e7a9099f7ff48ca02855583c1d841
Showing with 11 additions and 8 deletions.
  1. +11 −8 python/plugins/processing/algs/gdal/ogr2ogrtopostgis.py
@@ -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))

0 comments on commit be3e807

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