Skip to content

Commit

Permalink
Updated libpostgresql.sh to specify the loopback address as the host …
Browse files Browse the repository at this point in the history
…for psql commands

Signed-off-by: James Riley McHugh <mchugh_james@bah.com>
  • Loading branch information
James Riley McHugh committed Jun 29, 2024
1 parent 04efc37 commit 5095354
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ postgresql_start_bg() {
else
"${pg_ctl_cmd[@]}" "start" "${pg_ctl_flags[@]}" >/dev/null 2>&1
fi
local pg_isready_args=("-U" "postgres" "-p" "$POSTGRESQL_PORT_NUMBER")
local pg_isready_args=("-U" "postgres" "-p" "$POSTGRESQL_PORT_NUMBER" "-h" "127.0.0.1")
local counter=$POSTGRESQL_INIT_MAX_TIMEOUT
while ! "$POSTGRESQL_BIN_DIR"/pg_isready "${pg_isready_args[@]}" >/dev/null 2>&1; do
sleep 1
Expand Down Expand Up @@ -1078,7 +1078,7 @@ postgresql_execute_print_output() {
local opts
read -r -a opts <<<"${@:4}"

local args=("-U" "$user" "-p" "${POSTGRESQL_PORT_NUMBER:-5432}")
local args=("-U" "$user" "-p" "${POSTGRESQL_PORT_NUMBER:-5432}" "-h" "127.0.0.1")
[[ -n "$db" ]] && args+=("-d" "$db")
[[ "${#opts[@]}" -gt 0 ]] && args+=("${opts[@]}")

Expand Down

0 comments on commit 5095354

Please sign in to comment.