From e8ef80c1301a4a20ef3f41b980d42242639c8527 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Wed, 5 Jul 2006 10:12:58 +0000 Subject: [PATCH] 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 --- django/db/backends/postgresql/client.py | 9 +++++---- 1 file 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)