Ron St-Pierre <rstpierre(at)syscor(dot)com> writes:
> : I get this error:
> ERROR: infinite recursion detected in rules for relation "currentlist"
So what kind of rules have you got on "currentlist"? I don't believe
that complaint has anything to do with your plpgsql function.
regards, tom lane