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

2009-01-16 Thread Tom Lane
David Fetter writes: > Basically, there is no way I've found so far to qualify any window > function in the target list, which makes a giant POLA violation. The FM points out in at least two places that window functions logically execute on the output of the WHERE/GROUP BY/HAVING steps. It's co

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

2009-01-16 Thread David Fetter
On Fri, Jan 16, 2009 at 12:41:59PM -0500, Tom Lane wrote: > David Fetter writes: > > We don't appear to be able to use the actual thing in the target list > > either. > > Would you translate that into English? Or at least an example without > trivial syntax errors? This works: SELECT typ,

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

2009-01-16 Thread Tom Lane
David Fetter writes: > We don't appear to be able to use the actual thing in the target list > either. Would you translate that into English? Or at least an example without trivial syntax errors? regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@p

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

2009-01-16 Thread David Fetter
On Fri, Jan 16, 2009 at 12:34:34PM -0500, Tom Lane wrote: > David Fetter 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