Postgresql, plperl and custom rowtypes

I had a problem that I needed to solve recently, and the most elegant way to do this was with a stored procedure. However, the procedure needed to return 2 columns – an index id and a sort order. One way to tackle this is to have the plperl function called by a wrapping plpgsql function, but that’s ugly. I wanted to do it all in plperl, but couldn’t find any documentation on it with custom rowtypes. So, off to IRC for some info. xzilla on #postgresql (irc.freenode.net) pointed me out to a recent blog posting of his that seemed to do what I wanted using Out parameters. This was really great, and I knew I had something I could work with there. Thanks xzilla! So, I took it a bit further and modified his example slightly to see if I could also do it without the out parameters and […]... Read More