Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id B6525B5DBDC for ; Mon, 20 Jun 2011 22:55:58 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 89935-08 for ; Tue, 21 Jun 2011 01:55:52 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.22]) by mail.postgresql.org (Postfix) with SMTP id 25F6DB5DBCB for ; Mon, 20 Jun 2011 22:55:51 -0300 (ADT) Received: (qmail invoked by alias); 21 Jun 2011 01:55:49 -0000 Received: from p57BB64F4.dip.t-dialin.net (EHLO [192.168.1.113]) [87.187.100.244] by mail.gmx.net (mp010) with SMTP; 21 Jun 2011 03:55:49 +0200 X-Authenticated: #14269776 X-Provags-ID: V01U2FsdGVkX1/E9C4dCDDEbL92f+SwcLjPOJS8oZiN77GsncHieS tn6lfVcSNyDU09 Message-ID: <4DFFFA26.6010003@gmx.net> Date: Tue, 21 Jun 2011 03:55:50 +0200 From: Andreas User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: problem with selecting from a function Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, T_RP_MATCHES_RCVD=-0.01, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201106/72 X-Sequence-Number: 35538 Hi, I've got a table with a couple of objects. Primary key object_id. There is a function that fetches some values from another table that relate to an object_id. Like fctX ( 7 ) --> set of typX ... ( 14, 'bla' ), ( 17, 'blu' ), ( 21, 'ble' ), ... The result of the function can have 0 or more lines of a defined result-type typX. Those resulting numbers are not object_ids. Now I'd need a SELECT that lists all function results of all object_ids. Like: ... 6, ... 7, 14, 'bla' 7, 17, 'blu' 7, 21, 'ble' 8, ... Actually it was enough to get just the numerical column of the function result. I tried select object_id, fctX (object_id) from objects; Then I get: 7, (14, 'bla') 7, (17, 'blu') 7, (21, 'ble') <--- round brackets This looks like an array but how can I split it up to columns or at least extract the number-column?