Postgresql Select Into Multiple Variables For Loop