On Sun, Oct 15, 2006 at 04:11:30PM +1000, Marc McIntyre wrote: > You should use a set returning function. Your function can be rewritten > as a set returning function like so: Isn't there a way to return an array? SRFs are great, but not always the best tool. BTW, neither function should be marked as VOLATILE... they're actually IMMUTABLE as written. -- Jim Nasby jim@xxxxxxxxx EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)