Index: openacs-4/packages/fs-portlet/sql/postgresql/upgrade/upgrade-2.0.3-2.0.4.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/fs-portlet/sql/postgresql/upgrade/upgrade-2.0.3-2.0.4.sql,v
diff -u -N -r1.4 -r1.4.12.1
--- openacs-4/packages/fs-portlet/sql/postgresql/upgrade/upgrade-2.0.3-2.0.4.sql	13 Jan 2005 13:58:20 -0000	1.4
+++ openacs-4/packages/fs-portlet/sql/postgresql/upgrade/upgrade-2.0.3-2.0.4.sql	19 Aug 2014 16:54:18 -0000	1.4.12.1
@@ -5,19 +5,26 @@
 -- fs_contents_portlets get renamed properly.
 --
 
-create or replace function fold_rename() returns trigger as '
-declare
+
+
+--
+-- procedure fold_rename/0
+--
+CREATE OR REPLACE FUNCTION fold_rename(
+
+) RETURNS trigger AS $$
+DECLARE
   row_res record;
-begin
+BEGIN
 
   if old.label <> new.label then
     for row_res in select m.element_id
                 from portal_element_map m,
                 portal_element_parameters p
-  	        where p.key = ''folder_id''
+  	        where p.key = 'folder_id'
                   and p.value = new.folder_id
                   and m.element_id = p.element_id
-                  and m.name = ''fs_contents_portlet'' loop
+                  and m.name = 'fs_contents_portlet' loop
   
       update portal_element_map
       set pretty_name = new.label
@@ -26,7 +33,8 @@
     end loop;
 end if;
 return new;
-end; ' language 'plpgsql';
+END; 
+$$ LANGUAGE plpgsql;
 
 create trigger fs_cont_port_fldr_rnme_tr
 after update on cr_folders for each row
