Re: Returning composite types from a plpgsql function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joseph Barillari <jbarilla(at)princeton(dot)edu>
Cc: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Returning composite types from a plpgsql function
Date: 2002-05-03 22:24:01
Message-ID: 22683.1020464641@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Joseph Barillari <jbarilla(at)princeton(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jakub Ouhrabka 2002-05-04 14:00:11 difficult query
Previous Message Josh Berkus 2002-05-03 21:59:03 Re: Odd behavior with timestamp/interval arithmetic