Postgresql While Loop Exit Python Program In Code Implant