Postgresql While Loop Exit In Python What Does Bool