Index: openacs-4/packages/survey/sql/postgresql/survey-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/survey/sql/postgresql/survey-create.sql,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/survey/sql/postgresql/survey-create.sql	17 May 2003 12:29:17 -0000	1.8
+++ openacs-4/packages/survey/sql/postgresql/survey-create.sql	12 Jun 2003 03:54:46 -0000	1.9
@@ -539,9 +539,12 @@
 p_response_id 	alias for $1;
 v_user_id	integer;
 begin
-	select into v_user_id creation_user
-	from acs_objects where
-	object_id = survey_response__initial_response_id(p_response_id);
+	select into v_user_id o.creation_user
+	from acs_objects o,
+	     survey_responses s
+        where
+	object_id = coalesce(s.initial_response_id, s.response_id)
+	and s.response_id = p_response_id;
 return v_user_id;
 end;' language 'plpgsql';
 
@@ -558,8 +561,6 @@
 	PERFORM survey_response__del(v_response_row.response_id);
     end loop;
 
-    PERFORM survey_response__del(remove__response_id);
-
     return 0;
 
 end;' language 'plpgsql';
