Skip to content
Open
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
fix(pg_upgrade): do not restart PG if replication slots are present
  • Loading branch information
pcnc committed Jul 28, 2025
commit 5a04a8890eb8f911195c13b7128bcc5f6e42f2c4
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,11 @@ EOF
# Extra work to ensure postgres is actually stopped
# Mostly needed for PG12 projects with odd systemd unit behavior
if [ -z "$IS_CI" ]; then
retry 5 systemctl restart postgresql
REPLICATION_SLOT_COUNT=$(run_sql -A -t -c "SELECT COUNT(*) FROM pg_replication_slots;")
if [[ "$REPLICATION_SLOT_COUNT" -eq 0 ]]; then
echo "No replication slots found; restarting postgres"
retry 5 systemctl restart postgresql
fi
systemctl disable postgresql
retry 5 systemctl stop postgresql

Expand Down