problem with selecting from a function - Mailing list pgsql-sql

From Andreas
Subject problem with selecting from a function
Date
Msg-id 4DFFFA26.6010003@gmx.net
Whole thread Raw
Responses Re: problem with selecting from a function  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-sql
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?


pgsql-sql by date:

Previous
From: "Ross J. Reedstrom"
Date:
Subject: Re: Append n Rows into a Single Row
Next
From: Pavel Stehule
Date:
Subject: Re: problem with selecting from a function