pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas <maps.on@gmx.net>
To: pgsql-sql@postgresql.org
Subject: problem with selecting from a function
Date: Tue, 21 Jun 2011 03:55:50 +0200
Message-ID: <4DFFFA26.6010003@gmx.net> (raw)

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?



view thread (2+ messages)  latest in thread

Message-ID: <4DFFFA26.6010003@gmx.net>
Permalink:  ../4DFFFA26.6010003@gmx.net/
Also on:    postgresql.org/message-id/4DFFFA26.6010003@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: maps.on@gmx.net
  Subject: Re: problem with selecting from a function
  In-Reply-To: <4DFFFA26.6010003@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox