Index: openacs-4/packages/acs-kernel/sql/postgresql/postgresql.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/postgresql.sql,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/acs-kernel/sql/postgresql/postgresql.sql	27 Mar 2001 05:20:38 -0000	1.5
+++ openacs-4/packages/acs-kernel/sql/postgresql/postgresql.sql	2 Apr 2001 23:14:07 -0000	1.6
@@ -17,10 +17,10 @@
         
         if dir < 0 then
            v_inc := \-1;
-           v_i   := v_len;
+           v_i   := v_len + 1 - dir;
         else 
            v_inc := 1;
-           v_i   := 1;
+           v_i   := dir;
         end if;
            
         while v_i > 0 and v_i <= v_len LOOP
