Skip to content

Commit 6d11c7d

Browse files
committed
chore: fix run-server to be pg_hba version aware
1 parent e1815c7 commit 6d11c7d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

nix/tools/run-server.sh.in

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,17 @@ fi
213213

214214
# Copy configuration files
215215
echo "NOTE: patching postgresql.conf files"
216-
cp "$PG_HBA_FILE" "$DATDIR/pg_hba.conf"
216+
if [ "$VERSION" = "15" ]; then
217+
cp $(dirname "$PG_HBA_FILE")/pg_hba.conf_15* "$DATDIR/pg_hba.conf"
218+
else
219+
cp "${PG_HBA_FILE}" "$DATDIR/pg_hba.conf"
220+
# copy extra hba_*.conf files over
221+
extra_hba_files=( ${PG_HBA_FILE%pg_hba.conf}pg_hba*.conf* )
222+
for f in "${extra_hba_files[@]}"; do
223+
base=$(basename "$f")
224+
cp "$f" "$DATDIR/${base%%.conf*}.conf"
225+
done
226+
fi
217227
cp "$PG_IDENT_FILE" "$DATDIR/pg_ident.conf"
218228
cp "$READREPL_CONFIG_FILE" "$DATDIR/read-replica.conf"
219229
mkdir -p "$DATDIR/extension-custom-scripts"

0 commit comments

Comments
 (0)