Thanks - works like a charm. Hmmm. I tried that earlier and got errors. I just retried and it worked fine this time. I guess I had some other problem - It seems that sometimes I have to exit and reenter my psql session to use a newly interpreted version of my stored procedure, so maybe that was part of the problem...