Re: Pg, Netezza, and... Sybase?

From: "David Johnston" <polobo(at)yahoo(dot)com>
To: "'yary'" <not(dot)com(at)gmail(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Pg, Netezza, and... Sybase?
Date: 2012-10-01 20:52:15
Message-ID: 01c801cda016$a3d98a40$eb8c9ec0$@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> and indeed that is the exact bug I found in Netezza! "first_value"
> works great, "last_value" has window size 1 unless you also say "rows
> between unbounded preceding and unbounded following".
>

What Tom said but:

"...has window size 1" is not correct. The window size is larger but the
returned value is always just going to be the current (last) row so it only
appears to be "size 1" superficially.

The query's frame/range/window specification is independent of the functions
that use the window.

If you are confused as to what is currently in the frame specification you
should use something like

ARRAY_AGG(...) OVER (...)

To capture the relevant frame data into a single value.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Moshe Jacobson 2012-10-01 20:58:04 Re: What's faster? BEGIN ... EXCEPTION or CREATE TEMP TABLE IF NOT EXISTS?
Previous Message Tom Lane 2012-10-01 20:39:10 Re: Thousands of schemas and ANALYZE goes out of memory