Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 5C9E59FB3A3 for ; Tue, 17 Apr 2007 16:17:57 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 85850-05 for ; Tue, 17 Apr 2007 16:17:48 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from smtp105.mail.mud.yahoo.com (smtp105.mail.mud.yahoo.com [209.191.85.215]) by postgresql.org (Postfix) with SMTP id AE78A9FB435 for ; Tue, 17 Apr 2007 16:17:47 -0300 (ADT) Received: (qmail 25886 invoked from network); 17 Apr 2007 19:17:44 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.br; h=Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding; b=k4O8/iiCNmn0sqnflrEog9eH/JHb7d5l8AwvC1gb0EsfIwLyPL14fBEDiUr/XCB00KCHCpBtXigXnd5XFNETfL51uMdNTI3oappXOKmO6fvandzDbPDScGp0xgL8C/C+wNFwgM+iGBIme5cgtfVPEMuq5gdnoq/n1Rd8L7TQZpU= ; Received: from unknown (HELO ?10.90.2.103?) (burbello3000@200.103.143.8 with plain) by smtp105.mail.mud.yahoo.com with SMTP; 17 Apr 2007 19:17:43 -0000 Message-ID: <46251D50.2000601@yahoo.com.br> Date: Tue, 17 Apr 2007 16:17:36 -0300 From: "Alexander B." User-Agent: Thunderbird 1.5.0.7 (X11/20060911) MIME-Version: 1.0 To: "pgsql-admin@postgresql.org" Subject: Return data from function Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/158 X-Sequence-Number: 25222 Hello, I need to create a function that find data over 3 tables, merge and return data. With example can be specified more clearly: 1.1 Find all addresses code; 1.2 For each addresses code, get address, complement and city on the first table; 1.3 For each addresses code, get address, complement and city on the second table; 1.4 Merge result from first and second tables and return to the function; I would like to do not using cursor. Do you have any ideas how to implement? Thanks in advance.