Re: return MAX and when it happened

From: Scara Maccai <m_lists(at)yahoo(dot)it>
To: Sam Mason <sam(at)samason(dot)me(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: return MAX and when it happened
Date: 2008-11-19 23:06:14
Message-ID: 49249BE6.3050700@yahoo.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sam Mason wrote:
> The custom aggregate sounds the
> most elegant, it's just annoying that it's so much fiddling to get it
> all working to start with
Thanks.

I think I wrote it, but there's something I don't get from the docs: do
I have to call

get_call_result_type(fcinfo, NULL, &tupdesc)

every time?

I mean: the only example I've found about returning Composite Types
talks about returning sets as well (34.9.10. Returning Sets). In that
example the get_call_result_type call is done once:

if (SRF_IS_FIRSTCALL())
{
[...]
if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE)
[...]
}

Should I do something like that in my function or that only applies to
function returning sets?
I'm calling it every time now but I don't know if it's right...

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Koichi Suzuki 2008-11-20 00:04:28 Re: lesslog "incorrect resource manager data checksum."
Previous Message Howard Cole 2008-11-19 22:11:18 Re: How to reduce impact of a query.