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.2.2.8 -r1.2.2.9
--- openacs-4/packages/survey/sql/postgresql/survey-create.sql	2 Mar 2003 22:54:30 -0000	1.2.2.8
+++ openacs-4/packages/survey/sql/postgresql/survey-create.sql	12 Jun 2003 02:56:56 -0000	1.2.2.9
@@ -550,9 +550,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';
 
