Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a33860d

Browse files
PSQL passes a database name through the explicit '-d <dbname>' parameter
1 parent 2fa4426 commit a33860d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

testgres/node.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -1107,13 +1107,12 @@ def _psql(
11071107
else:
11081108
raise Exception("Input data must be None or bytes.")
11091109

1110-
dbname = dbname or default_dbname()
1111-
11121110
psql_params = [
11131111
self._get_bin_path("psql"),
11141112
"-p", str(self.port),
11151113
"-h", self.host,
11161114
"-U", username or self.os_ops.username,
1115+
"-d", dbname or default_dbname(),
11171116
"-X", # no .psqlrc
11181117
"-A", # unaligned output
11191118
"-t", # print rows only
@@ -1135,9 +1134,6 @@ def _psql(
11351134
else:
11361135
raise QueryException('Query or filename must be provided')
11371136

1138-
# should be the last one
1139-
psql_params.append(dbname)
1140-
11411137
return self.os_ops.exec_command(
11421138
psql_params,
11431139
verbose=True,

0 commit comments

Comments
 (0)