Skip to content

Commit

Permalink
init postgres: fix bug when local postgres is not running on default …
Browse files Browse the repository at this point in the history
…port
  • Loading branch information
jstucke committed Aug 8, 2024
1 parent 1c51802 commit 151b8d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/init_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def execute_psql_command(
# See https://www.postgresql.org/docs/current/auth-methods.html

if host in ['localhost', '127.0.0.1']:
shell_cmd = f'sudo runuser -u {user} -- psql -c "{psql_command}"'
shell_cmd = f'sudo runuser -u {user} -- psql --port={port} -c "{psql_command}"'
else:
shell_cmd = f'psql --host={host} --port={port} --username={user} -c "{psql_command}"'

Expand Down

0 comments on commit 151b8d3

Please sign in to comment.