make pg_num adjustments safe against pg_num going down