I experienced a lot of problems during database upgrade from Limesurvey 1.91+ to 200+ version. A note ahead: as the installed PHP version 5.2.4 is less the requested 5.3 for 2.05+, I report the problem in the forum instead of the Bugtracker, in which only reports should be posted relating to the latest stable version.

delete from lime_user_in_groups where ctid not in (select max (s.ctid) from lime_user_in_groups s group by s.ugid, s.uid) ;

2) The seconf problem was much harder to solve. Basically, it looks like as the try-catch statements don't show the expected effect on my installation. Concretely, whenever the DDL statement in the try clause resulted in a failure, the postgres server tried to "catch" all the following statements as well. In the logs, it looked like this: