Postgresql Function Select Into Variable Sql Statement