diff options
author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2006-07-05 10:12:58 +0000 |
---|---|---|
committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2006-07-05 10:12:58 +0000 |
commit | e8ef80c1301a4a20ef3f41b980d42242639c8527 (patch) | |
tree | 735d55ad73e796ed7e4cc6b1ed2a833f0aa7e268 /django/db/backends/postgresql/client.py | |
parent | c2556874d4d3e2631b082f567d28cc1d1e1dfee1 (diff) | |
download | django-e8ef80c1301a4a20ef3f41b980d42242639c8527.tar.gz |
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
Diffstat (limited to 'django/db/backends/postgresql/client.py')
-rw-r--r-- | django/db/backends/postgresql/client.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/django/db/backends/postgresql/client.py b/django/db/backends/postgresql/client.py index 3d0d7a0d2a..8123ec7848 100644 --- a/django/db/backends/postgresql/client.py +++ b/django/db/backends/postgresql/client.py @@ -2,13 +2,14 @@ from django.conf import settings 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) |