Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Malcolm Tredinnick authored July 05, 2006

Showing 1 changed file with 5 additions and 4 deletions. Show diff stats Hide diff stats

  1. 9  django/db/backends/postgresql/client.py
9  django/db/backends/postgresql/client.py
@@ -2,13 +2,14 @@
2 2
 import os
3 3
 
4 4
 def runshell():
5  
-    args = ['']
6  
-    args += ["-U%s" % settings.DATABASE_USER]
  5
+    args = ['psql']
  6
+    if settings.DATABASE_USER:
  7
+        args += ["-U", settings.DATABASE_USER]
7 8
     if settings.DATABASE_PASSWORD:
8 9
         args += ["-W"]
9 10
     if settings.DATABASE_HOST:
10  
-        args += ["-h %s" % settings.DATABASE_HOST]
  11
+        args.extend(["-h", settings.DATABASE_HOST])
11 12
     if settings.DATABASE_PORT:
12  
-        args += ["-p %s" % settings.DATABASE_PORT]
  13
+        args.extend(["-p", str(settings.DATABASE_PORT)])
13 14
     args += [settings.DATABASE_NAME]
14 15
     os.execvp('psql', args)

0 notes on commit e8ef80c

Please sign in to comment.
Something went wrong with that request. Please try again.