Gregory Stark writes:
> Even if they can support it shouldn't they reject functions that aren't
> actually window functions? What happens if you mark a perfectly normal
> function as a window function, does it behave sanely?
Yes, for small values of "sane". It will see all its arguments as NULL
Peter Eisentraut writes:
> Hitoshi Harada wrote:
>> - CREATE FUNCTION command accepts WINDOW keyword for non-c language
>> like plpgsql. Don't we need to throw error?
>
> The validator procedures of those languages should be made to reject that case
> if they can't support it.
Even if they can s
Hitoshi Harada wrote:
- CREATE FUNCTION command accepts WINDOW keyword for non-c language
like plpgsql. Don't we need to throw error?
The validator procedures of those languages should be made to reject
that case if they can't support it.
--
Sent via pgsql-hackers mailing list (pgsql-hackers
"Hitoshi Harada" writes:
> 2009/1/8 Tom Lane :
>> You mean set_mark? It's just to save an extra calculation of the
>> absolute location of the fetched row. See leadlag_common for an
>> example use: we can truncate the tuplestore if the offset is constant.
> Yeah, I mean set_mark :P) I already c
2009/1/8 Tom Lane :
> "Hitoshi Harada" writes:
>> - Is WinGetFuncArgInPartition()'s argument mark_pos required? For the
>> newbies to window functions, it seems a bit confusing, but
>> WinSetMarkPos() looks enough for the purpose AFAIK.
>
> You mean set_mark? It's just to save an extra calculatio
"Hitoshi Harada" writes:
> - CREATE FUNCTION command accepts WINDOW keyword for non-c language
> like plpgsql. Don't we need to throw error?
No. CREATE FUNCTION has no business trying to keep track of which
PLs implement what. That case won't do anything useful right now,
but it might do someth
Attached is a simple user-define window function as a test, which
calculates moving avg(). Writing this, I found that even with current
specification (i.e. limited frame clauses), user-define function can
emulate some kinds of moving frame for simple purpose.
CREATE OR REPLACE FUNCTION movavg(floa