Re: TODO items for window functions

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Hitoshi Harada" <umi(dot)tanuki(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: TODO items for window functions
Date: 2008-12-29 17:19:55
Message-ID: 162867790812290919i780d03a1r52bdf839d382249e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2008/12/29 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> 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;
>

+1

regards
Pavel Stehule

> but on reflection there seems to be a case also for
>
> create [or replace] window function mywindow(...) returns ...
> as 'mymodule, 'mywindow'
> language c;
>
> The main argument in favor of the latter is that window-ness will need
> to be a fixed property of a function that you can't change except by
> dropping and recreating it, because any existing views calling the
> function will have its window-ness embedded in them in the form of
> whether they use a FuncExpr or WindowFunc node to call it. So it
> doesn't feel quite like an optional attribute.
>
> However, if we do that then for consistency we'd have to invent
> DROP WINDOW FUNCTION, ALTER WINDOW FUNCTION, RENAME WINDOW FUNCTION,
> COMMENT ON WINDOW FUNCTION, yadda yadda, and insist that you refer
> to a function properly (with or without WINDOW) in each one of these
> commands. Which would be a real PITA to implement and document,
> and I can't see that it's doing anything much for users either.
>
> So I'm still leaning to the first way. Comments?
>
> regards, tom lane
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2008-12-29 17:20:16 Re: TODO items for window functions
Previous Message Pavel Stehule 2008-12-29 17:10:17 Re: plpgsql: numeric assignment to an integer variable errors out