Postgres Use Variable In Soql For Loops