Artis Caune escribió: > Ops, forget to mention that this function is not so simple and use > some plpgsql features. Ah, right, you only forgot to mention that other 99% of the requirements. What's wrong with your first example? -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support