Skip to content

Want Postgres to complete the autovacuum process after importing data from docker-entrypoint.sh #595

Closed
@BalleClorin

Description

@BalleClorin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    RequestRequest for image modification or feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions