Closed
Description
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."