Index: openacs-4/packages/acs-content-repository/sql/postgresql/content-revision.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/content-revision.sql,v
diff -u -r1.48.2.1 -r1.48.2.2
--- openacs-4/packages/acs-content-repository/sql/postgresql/content-revision.sql	10 Feb 2016 09:14:20 -0000	1.48.2.1
+++ openacs-4/packages/acs-content-repository/sql/postgresql/content-revision.sql	27 Nov 2016 10:10:37 -0000	1.48.2.2
@@ -790,14 +790,21 @@
 END;
 $$ LANGUAGE plpgsql stable strict;
 
--- show errors
-
+--
 -- Trigger to maintain latest_revision in cr_items
-
+--
 CREATE OR REPLACE FUNCTION cr_revision_latest_tr () RETURNS trigger AS $$
+DECLARE
+  v_latest_revision      cr_revisions.revision_id%TYPE;
 BEGIN
-  update cr_items set latest_revision = new.revision_id
-  where item_id = new.item_id;
+
+  select latest_revision from cr_items into v_latest_revision where item_id = new.item_id;
+
+  if v_latest_revision <> new.revision_id then
+     update cr_items set latest_revision = new.revision_id
+     where item_id = new.item_id;
+  end if;
+  
   return new;
 END;
 $$ LANGUAGE plpgsql;
