Index: openacs-4/packages/new-portal/sql/postgresql/upgrade/upgrade-2.6.0d1-2.6.0d2.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/sql/postgresql/upgrade/upgrade-2.6.0d1-2.6.0d2.sql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/new-portal/sql/postgresql/upgrade/upgrade-2.6.0d1-2.6.0d2.sql	8 Nov 2010 07:23:38 -0000	1.1
+++ openacs-4/packages/new-portal/sql/postgresql/upgrade/upgrade-2.6.0d1-2.6.0d2.sql	1 Nov 2013 21:45:33 -0000	1.2
@@ -8,21 +8,29 @@
 
 -- PG 9.x support - changes regarding usage of sequences
 
-create or replace function portal__new (integer,varchar,integer,integer,integer,varchar,varchar,varchar,timestamptz,integer,varchar,integer)
-returns integer as '
-declare
-    p_portal_id                     alias for $1;
-    p_name                          alias for $2;
-    p_theme_id                      alias for $3;
-    p_layout_id                     alias for $4;
-    p_template_id                   alias for $5;
-    p_default_page_name             alias for $6;
-    p_default_accesskey             alias for $7;
-    p_object_type                   alias for $8;
-    p_creation_date                 alias for $9;
-    p_creation_user                 alias for $10;
-    p_creation_ip                   alias for $11;
-    p_context_id                    alias for $12;
+
+
+-- added
+select define_function_args('portal__new','portal_id,name,theme_id,layout_id,template_id,default_page_name,default_accesskey,object_type,creation_date,creation_user,creation_ip,context_id');
+
+--
+-- procedure portal__new/12
+--
+CREATE OR REPLACE FUNCTION portal__new(
+   p_portal_id integer,
+   p_name varchar,
+   p_theme_id integer,
+   p_layout_id integer,
+   p_template_id integer,
+   p_default_page_name varchar,
+   p_default_accesskey varchar,
+   p_object_type varchar,
+   p_creation_date timestamptz,
+   p_creation_user integer,
+   p_creation_ip varchar,
+   p_context_id integer
+) RETURNS integer AS $$
+DECLARE
     v_portal_id                     portals.portal_id%TYPE;
     v_theme_id                      portals.theme_id%TYPE;
     v_layout_id                     portal_layouts.layout_id%TYPE;
@@ -32,7 +40,7 @@
     v_param                         record;
     v_new_element_id                integer;
     v_new_parameter_id              integer;
-begin
+BEGIN
 
     v_portal_id := acs_object__new(
         p_portal_id,
@@ -41,7 +49,7 @@
         p_creation_user,
         p_creation_ip,
         p_context_id,
-        ''t''
+        't'
     );
 
     if p_template_id is null then
@@ -75,8 +83,8 @@
             p_default_accesskey,
             v_portal_id,
             v_layout_id,
-            ''f'',
-            ''portal_page'',
+            'f',
+            'portal_page',
             p_creation_date,
             p_creation_user,
             p_creation_ip,
@@ -111,8 +119,8 @@
             v_page.accesskey,
             v_portal_id,
             v_page.layout_id,
-            ''f'',
-            ''portal_page'',
+            'f',
+            'portal_page',
             p_creation_date,
             p_creation_user,
             p_creation_ip,
@@ -125,7 +133,7 @@
                            where page_id = v_page.page_id
             loop
 
-                select nextval(''t_acs_object_id_seq'')
+                select nextval('t_acs_object_id_seq')
                 into v_new_element_id
                 from dual;
 
@@ -142,7 +150,7 @@
                              where element_id = v_element.element_id
                 loop
 
-                    select nextval(''t_acs_object_id_seq'')
+                    select nextval('t_acs_object_id_seq')
                     into v_new_parameter_id
                     from dual;
 
@@ -163,23 +171,33 @@
 
     return v_portal_id;
 
-end;' language 'plpgsql';
+END;
+$$ LANGUAGE plpgsql;
 
-create or replace function portal_datasource__set_def_param (integer,varchar,varchar,varchar,varchar)
-returns integer as '
-declare
-    p_datasource_id                 alias for $1;
-    p_config_required_p             alias for $2;
-    p_configured_p                  alias for $3;
-    p_key                           alias for $4;
-    p_value                         alias for $5;
-begin
 
+
+-- added
+select define_function_args('portal_datasource__set_def_param','datasource_id,config_required_p,configured_p,key,value');
+
+--
+-- procedure portal_datasource__set_def_param/5
+--
+CREATE OR REPLACE FUNCTION portal_datasource__set_def_param(
+   p_datasource_id integer,
+   p_config_required_p varchar,
+   p_configured_p varchar,
+   p_key varchar,
+   p_value varchar
+) RETURNS integer AS $$
+DECLARE
+BEGIN
+
     insert into portal_datasource_def_params
     (parameter_id, datasource_id, config_required_p, configured_p, key, value)
     values
-    (nextval(''t_acs_object_id_seq''), p_datasource_id, p_config_required_p, p_configured_p, p_key, p_value);
+    (nextval('t_acs_object_id_seq'), p_datasource_id, p_config_required_p, p_configured_p, p_key, p_value);
 
     return 0;
 
-end;' language 'plpgsql';
+END;
+$$ LANGUAGE plpgsql;
