Index: openacs-4/packages/categories/sql/postgresql/upgrade/upgrade-1.1.2d2-1.1.2d3.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/categories/sql/postgresql/upgrade/upgrade-1.1.2d2-1.1.2d3.sql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/categories/sql/postgresql/upgrade/upgrade-1.1.2d2-1.1.2d3.sql	1 Oct 2007 10:15:43 -0000	1.1
+++ openacs-4/packages/categories/sql/postgresql/upgrade/upgrade-1.1.2d2-1.1.2d3.sql	30 Mar 2013 22:50:44 -0000	1.2
@@ -1,18 +1,25 @@
 -- add missing alias for $1
 
-create or replace function category__name (
-    integer   -- category_id
-)
-returns integer as '
-declare
-    p_category_id       alias for $1;
+
+
+-- added
+select define_function_args('category__name','category_id');
+
+--
+-- procedure category__name/1
+--
+CREATE OR REPLACE FUNCTION category__name(
+   p_category_id integer
+) RETURNS integer AS $$
+DECLARE
     v_name      varchar;
-begin
+BEGIN
 	select name into v_name
 	from category_translations
 	where category_id = p_category_id
-	and locale = ''en_US'';
+	and locale = 'en_US';
 
         return 0;
-end;
-' language 'plpgsql';
\ No newline at end of file
+END;
+
+$$ LANGUAGE plpgsql;
\ No newline at end of file
