On Tue, Feb 26, 2008 at 11:36 AM, Shavonne Marietta Wijesinghe <shavonne(dot)marietta(at)studioform(dot)it> wrote: > BEGIN > SAVEPOINT s1; > ... code here ... > EXCEPTION > WHEN ... THEN > ROLLBACK TO s1; > ... code here ... > WHEN ... THEN > ROLLBACK TO s1; > ... code here ... > END; PostgreSQL doesn't have anonymous blocks. You need to write a function.