Postgresql While Loop Exit Python Interpreter Vscode