Fix PgSQL upgrade process failed