Postgresql Function Set Variable In Batch