Index: openacs-4/packages/acs-messaging/sql/postgresql/acs-messaging-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-messaging/sql/postgresql/acs-messaging-create.sql,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/acs-messaging/sql/postgresql/acs-messaging-create.sql	8 Dec 2001 01:17:59 -0000	1.6
+++ openacs-4/packages/acs-messaging/sql/postgresql/acs-messaging-create.sql	9 Dec 2001 04:21:58 -0000	1.7
@@ -93,6 +93,13 @@
 
 -- support for tree queries on acs_messages
 
+create function acs_message_get_tree_sortkey(integer) returns varbit as '
+declare
+  p_message_id    alias for $1;
+begin
+  return tree_sortkey from acs_messages where message_id = p_message_id;
+end;' language 'plpgsql';
+
 create function acs_message_insert_tr () returns opaque as '
 declare
         v_parent_sk     varbit  default null;
