Skip to content

PSQL passes a database name through the explicit '-d <dbname>' parameter #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions testgres/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1107,13 +1107,12 @@ def _psql(
else:
raise Exception("Input data must be None or bytes.")

dbname = dbname or default_dbname()

psql_params = [
self._get_bin_path("psql"),
"-p", str(self.port),
"-h", self.host,
"-U", username or self.os_ops.username,
"-d", dbname or default_dbname(),
"-X", # no .psqlrc
"-A", # unaligned output
"-t", # print rows only
Expand All @@ -1135,9 +1134,6 @@ def _psql(
else:
raise QueryException('Query or filename must be provided')

# should be the last one
psql_params.append(dbname)

return self.os_ops.exec_command(
psql_params,
verbose=True,
Expand Down