Re: return setof : alternatives to holder table

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: zhong ming wu <mr(dot)z(dot)m(dot)wu(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: return setof : alternatives to holder table
Date: 2010-08-15 10:10:28
Message-ID: 4C67BD14.5040405@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 15/08/10 18:00, zhong ming wu wrote:

> Thanks for any better solution to this

CREATE TYPE

However, you still have to have a special type around just for that
function, and you have to *maintain* it to ensure it always matches the
types/columns of the input tables.

I frequently wish for type inference in PL/PgSQL functions returning
query results, so Pg could essentially create and destroy a type along
with the function, allowing you to reference columns in the functions
results without having to use RETURNS RECORD and all that AS
(column-list) pain.

Of course, I don't want it badly enough to put my time where my mouth is
and try to code it ;-) . I'm not whining about the current situation,
just thinking about ways it could improve further.

--
Craig Ringer

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mike Christensen 2010-08-15 10:18:31 Re: return setof : alternatives to holder table
Previous Message zhong ming wu 2010-08-15 10:00:16 return setof : alternatives to holder table