summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/client.py
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2008-09-09 02:13:58 +0000
committerAdrian Holovaty <adrian@holovaty.com>2008-09-09 02:13:58 +0000
commit42a878cfeadf00f036a6110941550505d4d007af (patch)
tree77978dbd08382061fff62ba38f60a1f292b3b3b1 /django/db/backends/postgresql/client.py
parent8f78d7f9402f28daadb485f582eabb7bc0bdc527 (diff)
downloaddjango-42a878cfeadf00f036a6110941550505d4d007af.tar.gz
db: Gave each DatabaseClient class an 'executable_name' attribute (e.g., 'psql' or 'mysql'), so that we can use it to make a more helpful error message. Refs #8978
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8989 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/backends/postgresql/client.py')
-rw-r--r--django/db/backends/postgresql/client.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/django/db/backends/postgresql/client.py b/django/db/backends/postgresql/client.py
index 28daed833a..63f28a7b57 100644
--- a/django/db/backends/postgresql/client.py
+++ b/django/db/backends/postgresql/client.py
@@ -3,8 +3,10 @@ from django.conf import settings
import os
class DatabaseClient(BaseDatabaseClient):
+ executable_name = 'psql'
+
def runshell(self):
- args = ['psql']
+ args = [self.executable_name]
if settings.DATABASE_USER:
args += ["-U", settings.DATABASE_USER]
if settings.DATABASE_PASSWORD:
@@ -14,4 +16,4 @@ class DatabaseClient(BaseDatabaseClient):
if settings.DATABASE_PORT:
args.extend(["-p", str(settings.DATABASE_PORT)])
args += [settings.DATABASE_NAME]
- os.execvp('psql', args)
+ os.execvp(self.executable_name, args)