Implementation DISTINCT for window aggregate function: SUM

From: Eugen Konkov <kes-kes(at)yandex(dot)ru>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Implementation DISTINCT for window aggregate function: SUM
Date: 2020-04-18 11:46:55
Message-ID: 1233802865.20200418144655@yandex.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello PostgreSQL-development,

Oracle has implementation:

select id, amount, sum(DISTINCT amount) over () as total
from xx;

https://dbfiddle.uk/?rdbms=oracle_18&fiddle=8eeb60183ec9576ddb4b2c9f2874d09f

Why this is not possible in PG?
https://dbfiddle.uk/?rdbms=postgres_12&fiddle=97c05203af4c927ff9f206e164752767

Why Window-specific functions do not allow DISTINCT to be used within the function argument list.?
Which problems are exists?

--
Best regards,
Eugen Konkov

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2020-04-18 12:27:12 Re: Poll: are people okay with function/operator table redesign?
Previous Message Ranier Vilela 2020-04-18 11:42:27 Re: PG compilation error with Visual Studio 2015/2017/2019