Re: TODO items for window functions - Mailing list pgsql-hackers

From Hitoshi Harada
Subject Re: TODO items for window functions
Date
Msg-id e08cc0400812291002i3e1479d2o2dc8cb0b4ff29b9b@mail.gmail.com
Whole thread Raw
In response to Re: TODO items for window functions  ("Jaime Casanova" <jcasanov@systemguards.com.ec>)
List pgsql-hackers
2008/12/30 Jaime Casanova <jcasanov@systemguards.com.ec>:
> On Mon, Dec 29, 2008 at 11:59 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I wrote:
>>> * Support creation of user-defined window functions.  I think this is
>>> a "must have" for 8.4 --- we are not in the habit of building
>>> nonextensible basic features.  It doesn't seem that hard either.
>>> I think all we need do is to allow "WINDOW" as an attribute keyword
>>> in CREATE FUNCTION.  Does anyone have an objection or a better idea?
>>
>> What I had in mind when I wrote that was something like
>>
>>        create [or replace] function mywindow(...) returns ...
>>                as 'mymodule, 'mywindow'
>>                language c
>>                window;
>>
>
> i don't understand this window function stuff well yet, but AFAIU it
> is like an aggregate function that shows grouped values without
> grouping rows (ok, maybe a very laizy or novice definition) but if
> that is correct or near correct maybe we need to follow the same
> pattern:
>
> create function -- without any decoration
> create aggregate maybe with a decoration of being window o create
> window aggregate or something similar...
>

I prefer "create window function" because it is semantically readable
and window keyword is more similar to aggregate than immutable, or
strict.

And for drop/comment or so, I guess we don't need prepare window
keyword. It's because window function is represented in pg_proc
catalog only, whereas aggregate uses pg_proc and pg_aggregate. If
there weren't window keyword in DROP FUNCTION, we won't be worried
which function to be dropped?


Regards,




-- 
Hitoshi Harada


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: TODO items for window functions
Next
From: Tom Lane
Date:
Subject: Re: TODO items for window functions