postgresql: use configured port when invoking psql
This commit is contained in:
parent
7323d5e128
commit
eb7bbb4862
@ -225,14 +225,14 @@ in
|
|||||||
# Wait for PostgreSQL to be ready to accept connections.
|
# Wait for PostgreSQL to be ready to accept connections.
|
||||||
postStart =
|
postStart =
|
||||||
''
|
''
|
||||||
while ! psql postgres -c "" 2> /dev/null; do
|
while ! psql --port=${toString cfg.port} postgres -c "" 2> /dev/null; do
|
||||||
if ! kill -0 "$MAINPID"; then exit 1; fi
|
if ! kill -0 "$MAINPID"; then exit 1; fi
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
done
|
done
|
||||||
|
|
||||||
if test -e "${cfg.dataDir}/.first_startup"; then
|
if test -e "${cfg.dataDir}/.first_startup"; then
|
||||||
${optionalString (cfg.initialScript != null) ''
|
${optionalString (cfg.initialScript != null) ''
|
||||||
cat "${cfg.initialScript}" | psql postgres
|
cat "${cfg.initialScript}" | psql --port=${toString cfg.port} postgres
|
||||||
''}
|
''}
|
||||||
rm -f "${cfg.dataDir}/.first_startup"
|
rm -f "${cfg.dataDir}/.first_startup"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user