Index: openacs-4/packages/acs-content-repository/sql/postgresql/content-util.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/content-util.sql,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/acs-content-repository/sql/postgresql/content-util.sql	31 Mar 2001 05:12:47 -0000	1.4
+++ openacs-4/packages/acs-content-repository/sql/postgresql/content-util.sql	1 Apr 2001 05:57:53 -0000	1.5
@@ -61,6 +61,18 @@
 
 end;' language 'plpgsql';
 
+create function rule_exists (varchar,varchar) returns boolean as '
+declare
+        rule_name       alias for $1;
+        table_name      alias for $2;
+begin
+        return count(*) = 1
+          from pg_rules
+         where tablename::varchar = table_name
+           and rulename::varchar = rule_name;
+
+end;' language 'plpgsql';
+
 -- java stuff, deal with this later.
 
 /*
