Re: Window-functions patch handling of aggregates - Mailing list pgsql-hackers

From Hitoshi Harada
Subject Re: Window-functions patch handling of aggregates
Date
Msg-id e08cc0400812250249n325d26c1m399f1c7bf34cd5f7@mail.gmail.com
Whole thread Raw
In response to Re: Window-functions patch handling of aggregates  (Greg Stark <greg.stark@enterprisedb.com>)
Responses Re: Window-functions patch handling of aggregates  ("Pavel Stehule" <pavel.stehule@gmail.com>)
List pgsql-hackers
2008/12/25 Greg Stark <greg.stark@enterprisedb.com>:
> Yeah, it seems like adding a flag like iswindowable to aggregate functions
> is the safest option.
>
> It would be nice if it represented an abstract property of the state
> function or final function rather than just "works with the implementation
> of window functions". I'm not sure what that property is though -
> isidempotent? isreentrant? Maybe just  a vague isrepeatable?

No, I meant wrinting such like:

Datum
some_trans_fn(PG_FUNCTION_ARGS)
{ if (fcinfo->context && IsA(fcinfo->context, WindowAggState))   elog(ERROR, "some_agg does not support window
aggregate");

...
}

rather than adding column to catalog. To add flag you must add new
syntax for CREATE AGGREGATE, which is slightly more painful.

Regards,

-- 
Hitoshi Harada


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Window-functions patch handling of aggregates
Next
From: KaiGai Kohei
Date:
Subject: Updates of SE-PostgreSQL 8.4devel patches (r1348)