Index: openacs-4/packages/acs-lang/sql/postgresql/upgrade/upgrade-4.7d4-4.7d5.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/sql/postgresql/upgrade/upgrade-4.7d4-4.7d5.sql,v diff -u -r1.2 -r1.2.22.1 --- openacs-4/packages/acs-lang/sql/postgresql/upgrade/upgrade-4.7d4-4.7d5.sql 8 Feb 2003 20:03:33 -0000 1.2 +++ openacs-4/packages/acs-lang/sql/postgresql/upgrade/upgrade-4.7d4-4.7d5.sql 5 Sep 2014 16:29:49 -0000 1.2.22.1 @@ -72,24 +72,31 @@ values ('TH_TH', 'Thai (TH)', 'th', 'TH', 'THAI', 'THAILAND', 'TH8TISASCII', 'TIS-620', 't'); -- Forgot to add this locale earlier, some installations may have it already -create function inline_0 () -returns integer as ' -declare + + +-- +-- procedure inline_0/0 +-- +CREATE OR REPLACE FUNCTION inline_0( + +) RETURNS integer AS $$ +DECLARE v_locale_exists_p integer; -begin +BEGIN select count(*) into v_locale_exists_p - from ad_locales where locale = ''sv_SE''; + from ad_locales where locale = 'sv_SE'; - if v_locale_exists_p = ''0'' then + if v_locale_exists_p = '0' then insert into ad_locales (locale, label, language, country, nls_language, nls_territory, nls_charset, mime_charset, default_p) - values (''sv_SE'', ''Swedish (SE)'', ''sv'', ''SE'', ''SWEDISH'', ''SWEDEN'', - ''WE8ISO8859P1'', ''ISO-8859-1'', ''t''); + values ('sv_SE', 'Swedish (SE)', 'sv', 'SE', 'SWEDISH', 'SWEDEN', + 'WE8ISO8859P1', 'ISO-8859-1', 't'); end if; return 1; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_0 (); drop function inline_0 (); 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();