Implementation DISTINCT for window aggregate function: SUM - Mailing list pgsql-hackers

From Eugen Konkov
Subject Implementation DISTINCT for window aggregate function: SUM
Date
Msg-id 1233802865.20200418144655@yandex.ru
Whole thread Raw
Responses Re: Implementation DISTINCT for window aggregate function: SUM  (David Rowley <dgrowleyml@gmail.com>)
List 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




pgsql-hackers by date:

Previous
From: Ranier Vilela
Date:
Subject: Re: PG compilation error with Visual Studio 2015/2017/2019
Next
From: Robert Haas
Date:
Subject: Re: Poll: are people okay with function/operator table redesign?