Index: openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.9.1d3-5.9.1d4.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.9.1d3-5.9.1d4.sql,v
diff -u -N -r1.1.2.2 -r1.1.2.3
--- openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.9.1d3-5.9.1d4.sql	8 Jul 2016 15:59:41 -0000	1.1.2.2
+++ openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.9.1d3-5.9.1d4.sql	8 Jul 2016 16:02:31 -0000	1.1.2.3
@@ -14,7 +14,11 @@
 
    ELSE
 	-- verison earlier than 9.2, no "IF EXISTS"
-	drop view anon_func_seq;
+        select 1 from pg_views where viewname = 'anon_func_seq' into v_dummy;
+	IF v_dummy THEN
+	   drop view anon_func_seq;
+      	   ALTER SEQUENCE IF EXISTS t_anon_func_seq RENAME TO anon_func_seq;
+	END IF;
 
    END IF;
    return 1;
