Index: openacs-4/packages/acs-lang/sql/postgresql/upgrade/upgrade-5.0.0-5.0.1.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/sql/postgresql/upgrade/upgrade-5.0.0-5.0.1.sql,v
diff -u -r1.2 -r1.2.20.1
--- openacs-4/packages/acs-lang/sql/postgresql/upgrade/upgrade-5.0.0-5.0.1.sql	26 Feb 2004 15:28:45 -0000	1.2
+++ openacs-4/packages/acs-lang/sql/postgresql/upgrade/upgrade-5.0.0-5.0.1.sql	5 Sep 2014 16:29:49 -0000	1.2.20.1
@@ -7,12 +7,18 @@
 
 alter table lang_messages_audit drop constraint lang_messages_audit_pk;
 
-create function inline_0()
-returns integer as '
-declare
+
+
+--
+-- procedure inline_0/0
+--
+CREATE OR REPLACE FUNCTION inline_0(
+
+) RETURNS integer AS $$
+DECLARE
   v_rec           record;
   v_next_id       integer;
-begin
+BEGIN
 
   for v_rec in select message_key,
                        package_key,
@@ -22,7 +28,7 @@
                 order by overwrite_date 
   loop
 
-        select nextval(''lang_messages_audit_id_seq''::text) into v_next_id;
+        select nextval('lang_messages_audit_id_seq'::text) into v_next_id;
 
         update lang_messages_audit set audit_id = v_next_id
         where message_key = v_rec.message_key
@@ -33,7 +39,8 @@
 
   return 0;
 
-end;' language 'plpgsql';
+END;
+$$ LANGUAGE plpgsql;
 select inline_0();
 drop function inline_0();
 
