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: How to access multicolumn function results?
Date: Thu, 24 Jan 2013 01:58:25 +0100
Message-ID: <51008731.8020006@gmx.net> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>

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



view thread (2+ messages)  latest in thread

Message-ID: <51008731.8020006@gmx.net>
Permalink:  ../51008731.8020006@gmx.net/
Also on:    postgresql.org/message-id/51008731.8020006@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: How to access multicolumn function results?
  In-Reply-To: <51008731.8020006@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