Postgresql Function Return Setoffs