Skip site navigation (1) Skip section navigation (2)

Joining with result of a plpgsql function

From: "Matthew T(dot) O'Connor" <matthew(at)zeut(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Joining with result of a plpgsql function
Date: 2008-05-08 03:28:10
Message-ID: 4822734A.90507@zeut.net (view raw or flat)
Thread:
Lists: pgsql-sql
Hello,

I have a pl/pgsql function, defined as:

CREATE FUNCTION tms.get_tms_summary(id integer)
   RETURNS tms.tms_summary

get_tms_summary returns a composite type, tms_summary, which is 
comprised of several numerics.

What I would like to do is something like:

select f.id, f.name, tms.get_tms_summary(f.id) from foo f;

However this returns only three columns, the third of which is the 
entire complex data type in one column.

I can do: select * from tms.get_tms_summary(99);

But I would really like to be able to combine it with other data and get 
a result set that looked like:

f.id, f.name, tms_summary.col1, tms_summary.col2 ...


Any thoughts or suggestions?


Thank you,

Matthew O'Connor


Responses

pgsql-sql by date

Next:From: Stephan SzaboDate: 2008-05-08 04:07:19
Subject: Re: Joining with result of a plpgsql function
Previous:From: Julien CigarDate: 2008-05-07 17:00:23
Subject: Re: how to check if a point is contained in a polygon ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group