Postgres Set Variable Python Coding