Re: Window Functions: v07 APIs and buffering strateties - Mailing list pgsql-hackers

From Hitoshi Harada
Subject Re: Window Functions: v07 APIs and buffering strateties
Date
Msg-id e08cc0400810280922p2d71d61fm3f0ca392dec93fd3@mail.gmail.com
Whole thread Raw
In response to Re: Window Functions: v07 APIs and buffering strateties  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Window Functions: v07 APIs and buffering strateties
List pgsql-hackers
2008/10/28 Tom Lane <tgl@sss.pgh.pa.us>:
> "Hitoshi Harada" <umi.tanuki@gmail.com> writes:
>> OK, I'll try to remove it. I'm not used to bison so my first task is
>> to find where the conflict is...
>
> Use bison -v to get details of where the conflict is.  I find that
> the most common way to fix things is to postpone where the parser
> has to make a decision, which usually ends up meaning a slightly
> more verbose set of productions --- for instance instead of
>
>        foo: bar opt_baz
>
>        opt_baz: baz | /*EMPTY*/
>
> you might have to do
>
>        foo: bar baz | bar
>

Thanks for your advice. And I found the problem is around FRAME
clause. Now my question is:

Can "ROWS" be reserved_keyword?

In window specifications, we have

OVER (ORDER BY expr_list [(ROWS|RANGE) ... ])

and currently "ROWS" is not reserved so bison is confused with cases
of "ROWS" included in expr_list and in FRAME clause. Because there is
no delimiter between ORDER BY clause and FRAME (that is (ROWS |
RANGE)) clause, "ROWS" can be in expr_list as a_expr. I see "ROWS" has
been an unreserved keyword and that many places in gram.y such cases
have been avoided by other haking methods, but in this case, isn't it
possible such? If I missed something let me know it.

Regards,


-- 
Hitoshi Harada


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Updating FSM on recovery
Next
From: Tom Lane
Date:
Subject: Re: Window Functions: v07 APIs and buffering strateties