Re: TODO items for window functions

From: Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, David Fetter <david(at)fetter(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: TODO items for window functions
Date: 2009-02-05 04:35:19
Message-ID: e08cc0400902042035i677c21efh27325df1f94d5775@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2009/2/5 Bruce Momjian <bruce(at)momjian(dot)us>:
> Robert Haas wrote:
>> > I am not thrilled about inventing a new column for this, but how about
>> > a display like so:
>> >
>> > regression=# \df nth_value
>> > List of functions
>> > Schema | Name | Result data type | Argument data types
>> > ------------+-----------+------------------+---------------------------------
>> > pg_catalog | nth_value | anyelement | anyelement, integer OVER window
>> >
>> > or some other addition that only shows up when needed.
>>
>> I think this whole idea is a bad one. In the current release, you can do
>>
>> DROP FUNCTION Name ( Argument data types )
>>
>> ...and it will work. Maybe you will say that no one is doing this via
>> a script (which I wouldn't bet on, but it's possible) but I'm sure
>> people are doing it via cut and paste, because I have done exactly
>> this thing. Any of the various proposals for hacking up Argument data
>> types will make this no longer true, and somebody will get confused.
>> I think you should bite the bullet and add a "type" column (f for
>> regular function and w for window? could there be others in the
>> future?).
>
> Are we doing anything for this for 8.4?

I prefer adding column of type 'w'|'f' to attaching OVER keyword in
argument column, because type column approach is more general if it
may refer to not only window functions but also setof, trigger, and
those coming in the future (hypothetical set function maybe?). It
seems to me that the OVER keyword is not necessary to let him know he
needs it.

Regards,

--
Hitoshi Harada

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2009-02-05 05:17:01 Re: Synch Replication
Previous Message Andrew Chernow 2009-02-05 03:23:17 Re: Is a plan for lmza commpression in pg_dump