Postgresql Function Store Select Into Statement