summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/client.py
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-04-11 11:41:35 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-04-11 11:41:35 +0000
commitd18f75af447bc18b062564ab163943c16d79effc (patch)
treef7086d0df781be0cb86e51dcb6fd09f85f66b597 /django/db/backends/postgresql/client.py
parent0d2cf7bdd6ee7b404f6e0f8eebfa9e8979ba7671 (diff)
downloaddjango-d18f75af447bc18b062564ab163943c16d79effc.tar.gz
Fixed #10357 -- Fixed the "dbshell" command for Windows users.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10517 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/backends/postgresql/client.py')
-rw-r--r--django/db/backends/postgresql/client.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/django/db/backends/postgresql/client.py b/django/db/backends/postgresql/client.py
index 695017130f..13273b9fb5 100644
--- a/django/db/backends/postgresql/client.py
+++ b/django/db/backends/postgresql/client.py
@@ -1,5 +1,7 @@
-from django.db.backends import BaseDatabaseClient
import os
+import sys
+
+from django.db.backends import BaseDatabaseClient
class DatabaseClient(BaseDatabaseClient):
executable_name = 'psql'
@@ -14,4 +16,8 @@ class DatabaseClient(BaseDatabaseClient):
if settings_dict['DATABASE_PORT']:
args.extend(["-p", str(settings_dict['DATABASE_PORT'])])
args += [settings_dict['DATABASE_NAME']]
- os.execvp(self.executable_name, args)
+ if os.name == 'nt':
+ sys.exit(os.system(" ".join(args)))
+ else:
+ os.execvp(self.executable_name, args)
+