Jeff Davis <pgsql@xxxxxxxxxxx> writes: > What you want to do is pass each "perm_field" as a parameter. I think the OP is hoping for some sort of magic action-at-a-distance behavior whereby his function can access stuff that wasn't passed to it. Doesn't exist though ... regards, tom lane