Hi, a question that I imagine is a faq but have not been able to find much help. How do people implement insert or upate ( otherwise known as upsert ) behaviour in postgres i.e. insert a row if it's key does not exist in the database else update the existing row? I tried using an insert rule to delete any existing rows first then insert however this leads to infinitely recursive rules ( which postgres properly rejects. ) I'm guesisng that the most sensible approach would be a stored proc/function? Cheers G. -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general