Fixed #33854 -- Corrected the order of parameters in dbshell on PostgreSQL.

This commit is contained in:
Jarrett Keifer 2022-07-17 21:30:20 -07:00 committed by GitHub
parent b4817d20b9
commit 3e3e814166
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -32,9 +32,9 @@ class DatabaseClient(BaseDatabaseClient):
args += ["-h", host]
if port:
args += ["-p", str(port)]
args.extend(parameters)
if dbname:
args += [dbname]
args.extend(parameters)
env = {}
if passwd:

View File

@ -154,7 +154,7 @@ class PostgreSqlDbshellCommandTestCase(SimpleTestCase):
def test_parameters(self):
self.assertEqual(
self.settings_to_cmd_args_env({"NAME": "dbname"}, ["--help"]),
(["psql", "dbname", "--help"], None),
(["psql", "--help", "dbname"], None),
)
@skipUnless(connection.vendor == "postgresql", "Requires a PostgreSQL connection")