pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joseph Barillari <jbarilla@princeton.edu>
Cc: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: Returning composite types from a plpgsql function
Date: Fri, 03 May 2002 18:24:01 -0400
Message-ID: <22683.1020464641@sss.pgh.pa.us> (raw)
In-Reply-To: <m3offwaprb.fsf@washer.barillari.org>
References: <m3offwaprb.fsf@washer.barillari.org>

Joseph Barillari <jbarilla@princeton.edu> writes:
> Unfortunately, when I execute this, I get:

> cal=3D> select frob();
>    frob=20=20=20=20
> -----------
>  172795360
> (1 row)

You can't do anything useful with a rowtype function result except
select a single field from it.  The manual's discussion for SQL
functions also applies to PL-language functions:
http://www.ca.postgresql.org/users-lounge/docs/7.2/postgres/xfunc-sql.html#AEN26354

There is work afoot to allow
	SELECT ... FROM function(...)
which would make functions returning rowtypes a whole lot more useful.

			regards, tom lane



view thread (2+ messages)

Message-ID: <22683.1020464641@sss.pgh.pa.us>
Permalink:  ../22683.1020464641@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22683.1020464641@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, jbarilla@princeton.edu
  Subject: Re: Returning composite types from a plpgsql function
  In-Reply-To: <22683.1020464641@sss.pgh.pa.us>

* 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