WIP patch for basic window frame support

Поиск
Список
Период
Сортировка
Искать

WIP patch for basic window frame support

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Вложения:
No docs or regression tests yet, but it seems to work ... please check
against Oracle and DB2 behavior.  Supported cases are

	RANGE UNBOUNDED PRECEDING	-- same as AND CURRENT ROW
	RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
	RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
	ROWS UNBOUNDED PRECEDING	-- same as AND CURRENT ROW
	ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
	ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING

			regards, tom lane

Re: WIP patch for basic window frame support

От:
"Hitoshi Harada" <umi.tanuki@gmail.com>
Дата:
2008/12/31 Tom Lane :
> No docs or regression tests yet, but it seems to work ... please check
> against Oracle and DB2 behavior.  Supported cases are
>
>        RANGE UNBOUNDED PRECEDING       -- same as AND CURRENT ROW
>        ROWS UNBOUNDED PRECEDING        -- same as AND CURRENT ROW

Is this true?
I guess that the 7.11 rule 5.b in the spec says as far as the bound is
not specified in the window frame clause, all rows of the partition
are contained in the frame. The rule then removes rows from the
initial frame as the frame bound indicates.

So as the result,
RANGE UNBOUNDED PRECEDING
ROWS UNBOUNDED PRECEDING
both mean
(RANGE / ROWS) BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
if I don't miss something.

Regards,


-- 
Hitoshi Harada

Re: WIP patch for basic window frame support

От:
"Hitoshi Harada" <umi.tanuki@gmail.com>
Дата:
2009/1/5 Tom Lane :
> "Hitoshi Harada"  writes:
>> 2008/12/31 Tom Lane :
>>> RANGE UNBOUNDED PRECEDING       -- same as AND CURRENT ROW
>>> ROWS UNBOUNDED PRECEDING        -- same as AND CURRENT ROW
>
>> Is this true?
>
> 7.11 syntax rule 9 says so.  AFAICS general rule 5b doesn't discuss the
> case where  isn't present, and doesn't need to
> because of syntax rule 9.
>

OK, I've just found it and confirmed Oracle does so.



-- 
Hitoshi Harada

Re: WIP patch for basic window frame support

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
"Hitoshi Harada"  writes:
> 2008/12/31 Tom Lane :
>> RANGE UNBOUNDED PRECEDING       -- same as AND CURRENT ROW
>> ROWS UNBOUNDED PRECEDING        -- same as AND CURRENT ROW

> Is this true?

7.11 syntax rule 9 says so.  AFAICS general rule 5b doesn't discuss the
case where  isn't present, and doesn't need to
because of syntax rule 9.
		regards, tom lane

FAQ