Index: openacs-4/packages/faq/sql/postgresql/upgrade/upgrade-4.0-4.6.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/faq/sql/postgresql/upgrade/upgrade-4.0-4.6.sql,v
diff -u -N -r1.2 -r1.3
--- openacs-4/packages/faq/sql/postgresql/upgrade/upgrade-4.0-4.6.sql	17 May 2003 10:34:08 -0000	1.2
+++ openacs-4/packages/faq/sql/postgresql/upgrade/upgrade-4.0-4.6.sql	27 Oct 2014 16:41:29 -0000	1.3
@@ -1,13 +1,21 @@
-create or replace function faq__clone (integer,integer)
-returns integer as '
-declare
- p_new_package_id  	alias for $1;   --default null,
- p_old_package_id 	alias for $2;   --default null
+
+
+--
+-- procedure faq__clone/2
+--
+
+select define_function_args('faq__clone','new_package_id,old_package_id');
+
+CREATE OR REPLACE FUNCTION faq__clone(
+   p_new_package_id integer, --default null,
+   p_old_package_id integer  --default null
+
+) RETURNS integer AS $$
+DECLARE
  v_faq_id 		faqs.faq_id%TYPE;
  one_faq		record;
  entry			record;
-
-begin
+BEGIN
             -- get all the faqs belonging to the old package,
             -- and create new faqs for the new package
             for one_faq in select *
@@ -35,9 +43,9 @@
                end loop;
            end loop;
  return 0;
- end;
-' language 'plpgsql';
+ END;
 
+$$ LANGUAGE plpgsql;
 
 alter table faqs add column disabled_p char(1);
 alter table faqs alter disabled_p set default 'f';
