Index: openacs-4/packages/acs-lang/tcl/lang-catalog-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/lang-catalog-procs-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-lang/tcl/lang-catalog-procs-postgresql.xql 19 Dec 2002 16:00:53 -0000 1.1 +++ openacs-4/packages/acs-lang/tcl/lang-catalog-procs-postgresql.xql 11 Dec 2003 21:39:53 -0000 1.2 @@ -10,4 +10,49 @@ + + + update lang_messages + set sync_time = current_timestamp + where package_key = :package_key + and locale = :locale + + + + + + + select message_key, + message, + deleted_p + from lang_messages + where package_key = :package_key + and locale = :locale + and sync_time is not null + union + select lma1.message_key, + lma1.old_message, + lma1.deleted_p + from lang_messages_audit lma1 + where lma1.package_key = :package_key + and lma1.locale = :locale + and lma1.sync_time is not null + and lma1.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 = :locale + and lma2.sync_time is not null + ) + and not exists (select 1 + from lang_messages + where package_key = lma1.package_key + and message_key = lma1.message_key + and locale = :locale + and sync_time is not null + ) + + + +