replace postgresclose by commit