You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Put this before pg_ctl fast stop. May be this part should skipped or run using an environment variable...
echo "Waiting for Postgres autovacuum to start..."
CHECK=$(psql -U postgres link -t -c "select count(pid) from pg_stat_activity where backend_type='autovacuum worker'")
until [ ${CHECK} != 0 ]
do
sleep 15
CHECK=$(psql -U postgres link -t -c "select count(pid) from pg_stat_activity where backend_type='autovacuum worker'")
done
echo "Postgres autovacuum is running... waiting for it to complete.. may take while"
until [ ${CHECK} == 0 ]
do
sleep 15
CHECK=$(psql -U postgres link -t -c "select count(pid) from pg_stat_activity where backend_type='autovacuum worker'")
done
echo "Postgres autovacuum complete. Database can be shut down."