Skip site navigation (1) Skip section navigation (2)

Re: Windowing Function Patch Review -> NTH_VALUE

From: "Hitoshi Harada" <umi(dot)tanuki(at)gmail(dot)com>
To: "David Rowley" <dgrowley(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Windowing Function Patch Review -> NTH_VALUE
Date: 2008-11-10 14:24:41
Message-ID: e08cc0400811100624o77744b15me1bc009b74d292c1@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
2008/11/9 David Rowley <dgrowley(at)gmail(dot)com>:
> I'm having a little trouble understanding the standard for NTH_VALUE(). I
> would have assumed that NTH_VALUE(name,1) would return the first name in the
> window. The current patch is using 0 for the first.
>

Hmmm, good point... I haven't thought about it enough, just followed
the internal design. The window_seek() in nodeWindow.c, which is an
internal API, counts rows from 0 so the external behavior is simlar.
Nothing more :-P

Giving your comment, actually it seems to me strange that row_number()
returns 1 for the first row whereas the ntile(ve, 1) returns the
second. If there're no objections I will change it as you told.

Regards,


-- 
Hitoshi Harada

In response to

Responses

pgsql-hackers by date

Next:From: Ron MayerDate: 2008-11-10 14:26:04
Subject: Re: Patch for ISO-8601-Interval Input and output.
Previous:From: Hitoshi HaradaDate: 2008-11-10 14:19:02
Subject: Re: Windowing Function Patch Review -> NTILE function

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group