Received: from fido.inet-interactif.com (fido.inet-interactif.com [216.218.2.225]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f28GgKx53220 for ; Thu, 8 Mar 2001 11:42:20 -0500 (EST) (envelope-from boulat@inet-interactif.com) Received: from inet-interactif.com ([216.218.2.229]) by fido.inet-interactif.com (8.9.3/8.9.3) with ESMTP id LAA05119 for ; Thu, 8 Mar 2001 11:42:14 -0500 (EST) (envelope-from boulat@inet-interactif.com) Message-ID: <3AA7B6D4.C8BD7DB@inet-interactif.com> Date: Thu, 08 Mar 2001 11:44:04 -0500 From: Boulat Khakimov Organization: Inet Interactif Inc. X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.18 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Writing SQL functions in Postgres Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200103/179 X-Sequence-Number: 1832 Hi, I want to write an SQL function in postgres that returns row as a result. The problem is the select statement inside the funtion has a two table join. So I dont know what to put after SETOF CREATE FUNCTION dummy() RETURNS SETOF ????? AS 'select a.name,b.cc from tblusers a, tbldocs b where a.name=b.name' LANGUAGE 'SQL'; SETOF tblusers -- doesnt work ERROR: function declared to return type tblusers does not retrieve (tblusers.*) neither does SETOF tbldocs SETOF tblusers,tbldocs wont work either. Anyone was able to returns a row that is a result of few table joins inside the function??? Regards, Boulat Khakimov -- Nothing Like the Sun