Index: openacs-4/packages/file-storage/sql/postgresql/upgrade/upgrade-5.1.0a6-5.1.0a7.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/postgresql/upgrade/upgrade-5.1.0a6-5.1.0a7.sql,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/file-storage/sql/postgresql/upgrade/upgrade-5.1.0a6-5.1.0a7.sql 9 Aug 2004 13:57:16 -0000 1.1.2.1 +++ openacs-4/packages/file-storage/sql/postgresql/upgrade/upgrade-5.1.0a6-5.1.0a7.sql 7 Sep 2004 14:29:15 -0000 1.1.2.2 @@ -1,12 +1,13 @@ --set serveroutput on size 200000 create or replace function tmp_fs_name_duplicate ( - varchar + varchar, + integer ) returns integer as ' declare v_name alias for $1; --cr_items.name%TYPE - v_count integer; + v_count alias for $2; v_insert_pos integer; begin v_insert_pos := instr(v_name,''.'',-1)-1; @@ -55,7 +56,7 @@ --Name collision: change file.ext to file.n.ext v_count := v_count + 1; - v_new_name := select tmp_fs_name_duplicate(v_item_row.title,v_count); + select into v_new_name tmp_fs_name_duplicate(v_item_row.title,v_count); update cr_items set name = v_new_name where item_id=v_item_row.item_id; @@ -79,4 +80,4 @@ select inline_0(); drop function inline_0(); -drop function tmp_fs_name_duplicate(varchar); +drop function tmp_fs_name_duplicate(varchar,integer);