Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TyB73-000528-NI for pgsql-sql@arkaria.postgresql.org; Thu, 24 Jan 2013 00:56:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TyB72-0000nn-ND for pgsql-sql@arkaria.postgresql.org; Thu, 24 Jan 2013 00:56:16 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TyB70-0000nf-Pf for pgsql-sql@postgresql.org; Thu, 24 Jan 2013 00:56:14 +0000 Received: from mout.gmx.net ([212.227.15.19]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TyB6y-0007gv-Lg for pgsql-sql@postgresql.org; Thu, 24 Jan 2013 00:56:14 +0000 Received: from mailout-de.gmx.net ([10.1.76.10]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0M8ntS-1UAJeR3p1w-00CCWw for ; Thu, 24 Jan 2013 01:56:11 +0100 Received: (qmail invoked by alias); 24 Jan 2013 00:56:11 -0000 Received: from mue-88-130-7-112.dsl.tropolys.de (EHLO [192.168.1.113]) [88.130.7.112] by mail.gmx.net (mp010) with SMTP; 24 Jan 2013 01:56:11 +0100 X-Authenticated: #14269776 X-Provags-ID: V01U2FsdGVkX1/HMDEYxvLHkGuN2l4EOi8XhH1fiN8tA9G2lAYM9A swNMFtmNL1Y4Fp Message-ID: <51008731.8020006@gmx.net> Date: Thu, 24 Jan 2013 01:58:25 +0100 From: Andreas User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: How to access multicolumn function results? Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org Hi I've got functions that return a TABLE. If I call it with constant parameters like: SELECT * FROM some_fct( 42 ); I get a table with column names as the result as intended. When I rather call it with the parameter coming from another table I get a set of records where I don't know how to access specific columns: SELECT some_fct( some_id ) FROM some_other_table; Now I get e.g. the result ( id1, value11, value12, value13 ), ( id1, value14, value15, value16 ), ( id2, value24, value25, value26 ), ... How can I split this up to look like a normal table or view with the column names that are defined in the RETURNS TABLE ( ... ) expression of the function. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql