pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: Jeroen Olthof <j.olthof@millipede.nl>
Cc: pgsql-general@postgresql.org
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] function return multiply rows
Date: Fri, 27 Sep 2002 09:44:55 -0700
Message-ID: <3D948B07.5050205@joeconway.com> (raw)
References: <amrnt5$1ivj$1@news.hub.org>

Jeroen Olthof wrote:
> What is going wrong here?
> 
> An example of what I'm trying to do.
> 
> vw_teams is a view but same problem when trying it on a single table
> CREATE FUNCTION test() RETURNS SETOF vw_teams AS 'select * from vw_teams;'
> LANGUAGE 'sql';
> 
> SELECT test();
> 
> results in
> 
>    test
> -----------
>  137789256
>  137789256
> (2 rows)

The capability to return composite types (multi-column rows) is limited in <= 
PostgreSQL 7.2.x. What you are seeing are pointers to the rows, not the rows 
themselves.

Version 7.3, in beta testing now, will do what you are looking for. If you 
can, please give it a try. See:
   http://developer.postgresql.org/docs/postgres/xfunc-tablefunctions.html
for more info and examples.

HTH,

Joe




view thread (3+ messages)  latest in thread

Message-ID: <3D948B07.5050205@joeconway.com>
Permalink:  ../3D948B07.5050205@joeconway.com/
Also on:    postgresql.org/message-id/3D948B07.5050205@joeconway.com

 · 

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: mail@joeconway.com, j.olthof@millipede.nl, pgsql-general@postgresql.org
  Subject: Re: [SQL] function return multiply rows
  In-Reply-To: <3D948B07.5050205@joeconway.com>

* 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