Re: Windowing functions vs aggregates

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Teodor Sigaev <teodor(at)sigaev(dot)ru>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Windowing functions vs aggregates
Date: 2009-04-14 13:35:53
Message-ID: 9062.1239716153@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Teodor Sigaev <teodor(at)sigaev(dot)ru> writes:
> Cast of aggregate's type works:
> # select avg(s)::int4 from foo;

> but that doesn't work for with new windowing functions interface:
> # select avg(s)::int4 OVER () from foo;
> ERROR: syntax error at or near "OVER"
> LINE 1: select avg(s)::int4 OVER () from foo;

> Is that intentional?

You would need to put the cast around the whole "foo() over ()"
construct. That's not a divisible unit.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-04-14 13:58:29 Re: Windowing functions vs aggregates
Previous Message Euler Taveira de Oliveira 2009-04-14 13:26:52 Re: Why isn't stats_temp_directory automatically created?