Re: [GENERAL] Question regarding new windowing functions in 8.4devel

Поиск
Список
Период
Сортировка
От David Fetter
Тема Re: [GENERAL] Question regarding new windowing functions in 8.4devel
Дата
Msg-id 20090116173821.GD20296@fetter.org
обсуждение исходный текст
Ответ на Re: [GENERAL] Question regarding new windowing functions in 8.4devel  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [GENERAL] Question regarding new windowing functions in 8.4devel  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Fri, Jan 16, 2009 at 12:34:34PM -0500, Tom Lane wrote:
> David Fetter <david@fetter.org> writes:
> > I tried this:
>
> > SELECT
> >     typ,
> >     ts,
> >     rank() over w AS foo_rank
> > FROM
> >     foo
> >         WINDOW  w AS (partition by typ order by ts desc)
> > WHERE
> >     foo_rank < 4;
>
> > ERROR:  syntax error at or near "WHERE"
> > LINE 8: WHERE
> >         ^
>
> RTFM ... WINDOW goes after WHERE (and GROUP BY, HAVING, ...)

Thanks :)

> Also, we have never allowed SELECT-alias references in WHERE; window
> functions have nothing to do with that.

We don't appear to be able to use the actual thing in the target list
either.  At a minimum, this is a pretty enormous POLA violation, and I
think it rises to the level of a bug.

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "David E. Wheeler"
Дата:
Сообщение: Re: FWD: Re: Updated backslash consistency patch
Следующее
От: Gianni Ciolli
Дата:
Сообщение: FATAL: could not open relation pg_tblspc/491086/467369/491103: No such file or directory