Re: review: More frame options in window functions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: review: More frame options in window functions
Date
Msg-id 29040.1265661802@sss.pgh.pa.us
Whole thread Raw
In response to Re: review: More frame options in window functions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I wrote:
> I started looking at this patch.  I believe that we should commit the 
> AggGetMemoryContext API function --- *not* the window context
> management changes that you included here, but only the API abstraction
> --- to be sure that that gets into 9.0 so that third-party aggregate
> functions can start relying on it instead of looking directly at the
> AggState or WindowAggState node.  The rest of the patch might or might
> not make it, but we can at least help people future-proof their code.

I have committed that little part.  I revised the function API to be

/* AggCheckCallContext can return one of the following codes, or 0: */
#define AGG_CONTEXT_AGGREGATE    1            /* regular aggregate */
#define AGG_CONTEXT_WINDOW       2            /* window function */

extern int  AggCheckCallContext(FunctionCallInfo fcinfo,                               MemoryContext *aggcontext);

so that it would be conveniently usable in places that just want to
check aggregate-ness and don't need to fetch a memory context; and
with the thought that maybe someday there would be more than two
possible call contexts.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tim Bunce
Date:
Subject: Re: Add on_plperl_init and on_plperlu_init to plperl UPDATE 3 [PATCH]
Next
From: Robert Haas
Date:
Subject: Re: Writeable CTEs patch