Index: openacs-4/packages/forums/sql/postgresql/upgrade/upgrade-1.3d3-1.3d4.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/sql/postgresql/upgrade/upgrade-1.3d3-1.3d4.sql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/forums/sql/postgresql/upgrade/upgrade-1.3d3-1.3d4.sql	15 May 2007 20:14:40 -0000	1.2
+++ openacs-4/packages/forums/sql/postgresql/upgrade/upgrade-1.3d3-1.3d4.sql	12 Aug 2013 09:34:31 -0000	1.3
@@ -4,30 +4,36 @@
 -- And now rewrite the new function as old installations will not have this updated version that stores the package_id
 select define_function_args('forums_forum__new','forum_id,object_type;forums_forum,name,charter,presentation_type,posting_policy,package_id,creation_date,creation_user,creation_ip,context_id');
 
-create or replace function forums_forum__new (integer,varchar,varchar,varchar,varchar,varchar,integer,timestamptz,integer,varchar,integer)
-returns integer as '
-declare
-    p_forum_id                      alias for $1;
-    p_object_type                   alias for $2;
-    p_name                          alias for $3;
-    p_charter                       alias for $4;
-    p_presentation_type             alias for $5;
-    p_posting_policy                alias for $6;
-    p_package_id                    alias for $7;
-    p_creation_date                 alias for $8;
-    p_creation_user                 alias for $9;
-    p_creation_ip                   alias for $10;
-    p_context_id                    alias for $11;
+
+
+--
+-- procedure forums_forum__new/11
+--
+CREATE OR REPLACE FUNCTION forums_forum__new(
+   p_forum_id integer,
+   p_object_type varchar, -- default 'forums_forum'
+   p_name varchar,
+   p_charter varchar,
+   p_presentation_type varchar,
+   p_posting_policy varchar,
+   p_package_id integer,
+   p_creation_date timestamptz,
+   p_creation_user integer,
+   p_creation_ip varchar,
+   p_context_id integer
+
+) RETURNS integer AS $$
+DECLARE
     v_forum_id                      integer;
-begin
+BEGIN
     v_forum_id:= acs_object__new(
         p_forum_id,
         p_object_type,
         p_creation_date,
         p_creation_user,
         p_creation_ip,
         coalesce(p_context_id, p_package_id),
-        ''t'',
+        't',
         p_name,
         p_package_id
     );
@@ -38,5 +44,6 @@
     (v_forum_id, p_name, p_charter, p_presentation_type, p_posting_policy, p_package_id);
 
     return v_forum_id;
-end;
-' language 'plpgsql';
+END;
+
+$$ LANGUAGE plpgsql;
