Did some searching on forums archives to no avail, I found a PL/Perl example but would like to do this in plpgsql if possible. Does somebody have this sitting around, I just dont want to reinvent the wheel. But if need to I will.
Thanks in advance,
Oisin