Re: review: More frame options in window functions

From: Robert Haas <robertmhaas(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>, Erik Rijkers <er(at)xs4all(dot)nl>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: review: More frame options in window functions
Date: 2010-02-12 00:10:18
Message-ID: 603c8f071002111610w6d122c6ckd2923c3c193e841e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Feb 11, 2010 at 4:31 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Mon, Feb 8, 2010 at 10:37 PM, Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com> wrote:
>>> 2010/2/9 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
>>>> Given the lack of time remaining in this CF, I'm tempted to propose
>>>> ripping out the RANGE support and just trying to get ROWS committed.
>>>> That should be substantially less controversial from a semantic
>>>> standpoint, and it still seems like a considerable improvement in
>>>> functionality.
>>>
>>> As expected. I don't mind splitting patch to be committable if users
>>> who expected this feature don't mind.
>
>> Well, they'll likely be happier with a partial feature than no feature
>> at all...  I agree with Tom that there's no time time now to resolve
>> the issue of how + and - should be handled.
>
> I've done that and am reviewing the rest of the patch, but I had more
> trouble than I expected with phrasing the "not implemented" message.
> Usually we try to word these things like "SQLCOMMAND is not implemented"
> but there's no one-word version of what it is that's been left out.
> "RANGE" isn't right since there are variants of RANGE that work.
> What I have at the moment is
>
>        if (n->frameOptions & (FRAMEOPTION_START_VALUE_PRECEDING |
>                               FRAMEOPTION_END_VALUE_PRECEDING))
>            ereport(ERROR,
>                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
>                     errmsg("RANGE value PRECEDING is not implemented yet"),
>                     parser_errposition(@1)));
>        if (n->frameOptions & (FRAMEOPTION_START_VALUE_FOLLOWING |
>                               FRAMEOPTION_END_VALUE_FOLLOWING))
>            ereport(ERROR,
>                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
>                     errmsg("RANGE value FOLLOWING is not implemented yet"),
>                     parser_errposition(@1)));
>
> but I wonder if anyone has a better idea.

Maybe something like this?

RANGE PRECEDING is only supported with UNBOUNDED

...Robert

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Takahiro Itagaki 2010-02-12 00:24:55 Re: psql tab completion for DO blocks
Previous Message Jeff Davis 2010-02-12 00:00:41 Re: Confusion over Python drivers {license}