Postgresql Function Store Select Into Sql Command Update