Index: openacs-4/packages/acs-lang/sql/postgresql/upgrade/upgrade-5.0.0b4-5.0.0b5.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/sql/postgresql/upgrade/upgrade-5.0.0b4-5.0.0b5.sql,v diff -u -r1.1.2.2 -r1.1.2.3 --- openacs-4/packages/acs-lang/sql/postgresql/upgrade/upgrade-5.0.0b4-5.0.0b5.sql 11 Dec 2003 12:40:17 -0000 1.1.2.2 +++ openacs-4/packages/acs-lang/sql/postgresql/upgrade/upgrade-5.0.0b4-5.0.0b5.sql 12 Dec 2003 23:55:58 -0000 1.1.2.3 @@ -36,22 +36,22 @@ -- Messages with only one revision -- This query is slow. Not sure how to speed it up. -update lang_messages lm - set lm.sync_time = current_timestamp +update lang_messages + set sync_time = current_timestamp where not exists (select 1 from lang_messages_audit lma - where lma.package_key = lm.package_key - and lma.message_key = lm.message_key - and lma.locale = lm.locale + where lma.package_key = lang_messages.package_key + and lma.message_key = lang_messages.message_key + and lma.locale = lang_messages.locale ); -- Messages with multiple revisions -- This query is slow as well. - update lang_messages_audit lma1 - set lma1.sync_time = current_timestamp - where lma1.overwrite_date = (select min(lma2.overwrite_date) + update lang_messages_audit + set sync_time = current_timestamp + where overwrite_date = (select max(lma2.overwrite_date) from lang_messages_audit lma2 - where lma2.package_key = lma1.package_key - and lma2.message_key = lma1.message_key - and lma2.locale = lma1.locale + where lma2.package_key = lang_messages_audit.package_key + and lma2.message_key = lang_messages_audit.message_key + and lma2.locale = lang_messages_audit.locale );