Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #2278 -- Fixed some argument parsing problems with the PostgreSQL

dbshell. Also added in the process name to the arg list so that the output of
'ps' looks sensible.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3278 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit e8ef80c1301a4a20ef3f41b980d42242639c8527 1 parent c255687
@malcolmt malcolmt authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 django/db/backends/postgresql/client.py
View
9 django/db/backends/postgresql/client.py
@@ -2,13 +2,14 @@
import os
def runshell():
- args = ['']
- args += ["-U%s" % settings.DATABASE_USER]
+ args = ['psql']
+ if settings.DATABASE_USER:
+ args += ["-U", settings.DATABASE_USER]
if settings.DATABASE_PASSWORD:
args += ["-W"]
if settings.DATABASE_HOST:
- args += ["-h %s" % settings.DATABASE_HOST]
+ args.extend(["-h", settings.DATABASE_HOST])
if settings.DATABASE_PORT:
- args += ["-p %s" % settings.DATABASE_PORT]
+ args.extend(["-p", str(settings.DATABASE_PORT)])
args += [settings.DATABASE_NAME]
os.execvp('psql', args)
Please sign in to comment.
Something went wrong with that request. Please try again.