Why can't I use windowing functions over ordered aggregates?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Why can't I use windowing functions over ordered aggregates?
Date: 2013-06-21 01:32:33
Message-ID: 51C3AD31.2080504@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hackers,

So, I can create a custom aggregate "first" and do this:

SELECT first(val order by ts desc) ...

And I can do this:

SELECT first_value(val) OVER (order by ts desc)

... but I can't do this:

SELECT first_value(val order by ts desc)

... even though under the hood, it's the exact same operation.

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-06-21 01:32:35 Re: changeset generation v5-01 - Patches & git tree
Previous Message Josh Berkus 2013-06-21 01:28:07 Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)