pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Stark <gsstark@mit.edu>
To: Christoph Haller <ch@rodos.fzk.de>
Cc: pgsql-sql@postgresql.org
Cc: fernando@icreativa.com.mx
Cc: gsstark@MIT.EDU
Subject: Re: SETOF
Date: 05 Mar 2003 08:36:29 -0500
Message-ID: <87u1ei7x5u.fsf@stark.dyndns.tv> (raw)
In-Reply-To: <3E65F78E.7455651B@rodos.fzk.de>
References: <3E65F78E.7455651B@rodos.fzk.de>

Christoph Haller <ch@rodos.fzk.de> writes:

> >
> >
> > Christoph Haller <ch@rodos.fzk.de> writes:
> >
> > > You cannot obtain several columns from SQL functions.
> > > See the list archives (search for SETOF) for details.
> > > You have to use e.g. a plpgsql function instead.
> >
> > How do you do it with a plpgsql function?
>
> And Greg, refer to
> http://techdocs.postgresql.org/guides/SetReturningFunctions
> 
> I think it will fit your needs.

That document describes using the function in the from list of the select.
That's equivalent to converting the query to a join, which isn't always
possible or convenient. I was talking about using a subquery or function in
the output column list to produce multiple output columns.

I'm sorry I may have muddied the waters in that it sounds like my comment
wasn't about exactly the same issue as Chistoph's. 

-- 
greg




view thread (8+ messages)  latest in thread

Message-ID: <87u1ei7x5u.fsf@stark.dyndns.tv>
Permalink:  ../87u1ei7x5u.fsf@stark.dyndns.tv/
Also on:    postgresql.org/message-id/87u1ei7x5u.fsf@stark.dyndns.tv

 · 

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: gsstark@mit.edu, ch@rodos.fzk.de, fernando@icreativa.com.mx
  Subject: Re: SETOF
  In-Reply-To: <87u1ei7x5u.fsf@stark.dyndns.tv>

* 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