Look in the plpgsql docs on EXECUTE. But for something that simple, why don't you just generate a query ?
---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly