Postgresql Function Set Variable In Python