The link listed for the plpgsql documentation didn't work for me, probably as a result of the new web site being rolled out for postgresql. Here is a link to the relevant section of the interactive docs: http://www.postgresql.org/idocs/inde...rammer-pl.html