Index: openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.0.0-5.1.0d1.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.0.0-5.1.0d1.sql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.0.0-5.1.0d1.sql	9 Feb 2004 20:39:07 -0000	1.3
+++ openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.0.0-5.1.0d1.sql	12 Feb 2004 17:00:14 -0000	1.4
@@ -683,3 +683,24 @@
   return 0; 
 end;' language 'plpgsql';
 
+create or replace function content_type__is_content_type (varchar)
+returns boolean as '
+declare
+  is_content_type__object_type            alias for $1;  
+  v_is_content_type                       boolean;
+begin
+
+  if is_content_type__object_type = ''content_revision'' then
+
+    v_is_content_type := ''t'';
+
+  else    
+    select count(*) > 0 into v_is_content_type
+    from acs_object_type_supertype_map
+    where object_type = is_content_type__object_type 
+    and ancestor_type = ''content_revision'';
+  end if;
+  
+  return v_is_content_type;
+ 
+end;' language 'plpgsql' stable;
