Index: openacs-4/packages/acs-kernel/sql/postgresql/acs-objects-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/acs-objects-create.sql,v
diff -u -r1.29 -r1.29.2.1
--- openacs-4/packages/acs-kernel/sql/postgresql/acs-objects-create.sql	27 Jan 2002 00:19:36 -0000	1.29
+++ openacs-4/packages/acs-kernel/sql/postgresql/acs-objects-create.sql	9 Mar 2002 23:34:32 -0000	1.29.2.1
@@ -713,9 +713,14 @@
     -- because the table names appear to be stored in upper case.  Quoting
     -- causes them to not match the actual lower or potentially mixed-case
     -- table names.  We will just forbid squirrely names that include quotes.
+-- daveB
+-- ETP is creating a new object, but not a table, although it does specify a
+-- table name, so we need to check if the table exists. Wp-slim does this too
 
-    execute ''delete from '' || obj_type.table_name ||
-        '' where '' || obj_type.id_column || '' =  '' || delete__object_id;
+    if table_exists(obj_type.table_name) then
+      execute ''delete from '' || obj_type.table_name ||
+          '' where '' || obj_type.id_column || '' =  '' || delete__object_id;
+    end if;
   end loop;
 
   return 0; 
