Postgresql Function Store Select Into Variable