Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1orlNz-0006Qa-2T for pgsql-novice@arkaria.postgresql.org; Sun, 06 Nov 2022 19:32:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1orlNx-0004X3-EP for pgsql-novice@arkaria.postgresql.org; Sun, 06 Nov 2022 19:32:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1orlNx-0004Wu-5k for pgsql-novice@lists.postgresql.org; Sun, 06 Nov 2022 19:32:49 +0000 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1orlNv-0005Lc-AQ for pgsql-novice@lists.postgresql.org; Sun, 06 Nov 2022 19:32:48 +0000 Received: by mail-pg1-x52d.google.com with SMTP id v3so8682449pgh.4 for ; Sun, 06 Nov 2022 11:32:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=ABAsmcjWqcXp8Hr6RnQxsVJ39CgttYbXXuTaAzVA3i4=; b=A9fGXdICUDJ+X2vf6kTQhMCZ7s8+LGpJghzBigh5EqSa2TUBFssNGJAFwKx6zqvRH8 xGZRSCJ0QTaYBwwiDAvg4pEdz7XUsGp+XOrAEYTw1MYaNk4TIPesPUICqfdlDp2L/zLN H+ooxulu28jujLjp/P5oDt6aLOWQGtnrPly8YqB+xGLWysfhkcMTuM75sxBj4kDzKMiz GoaxOBc/eF/BuKQzGCpdNkZsqtPVMBclUyVqiObP+6G/y9HpvVuYRTH2ka0S6NWWf3vZ WgIdMLD5JN3XaUxlumm9qRQsyYh6IArnrDwYqPA/HPVA5k5DdpueOMH6V65ZcOP7vW5a UYwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ABAsmcjWqcXp8Hr6RnQxsVJ39CgttYbXXuTaAzVA3i4=; b=rMs3eYqqFsS67YHa7oZo/9Rs3/JhmxKYPOjWbOUJ7YmCSsxGN9dyAm5UO8kqsyxMrj r7LA/pD4KzjEXMwgZSBg3s0/u7iENLHdYtROBQHe4e6jz2xrLWi6FIKB0fcZWrAoiwHm f1y8r1ufdSm/6nlxMASnZ4EUAtUWUhWEi4s5GXscL0w6YOYK1MFaNPG0uKMMjyOSAQ9M 2331CnpBMlJmrtbrpMSGv/77ibHJiBgTgbmJfeA+bzaU/buxOq4xaj84VCb31UGMMGV9 ngOJkJAKr5CIZKyB8GUVKaRb9uGCgtlhObd/aGLTooG/kEsAjTV93gq2Q4N+5I9Hm8EF 3yog== X-Gm-Message-State: ACrzQf2ynNDla4vgAjvoKFKgRp9gJC1csSfTk/JvLOlzz6eZ293TlG59 0wgXaBIXN9NFvlgS95Jx0uM= X-Google-Smtp-Source: AMsMyM5aiZiQK99xXPRABf6e26+CvhHjOITzetnqcH4F7g0qjQw0oJOiYViPtne8O/sSMXUlfGNnug== X-Received: by 2002:a63:2ad8:0:b0:46e:bb8e:b343 with SMTP id q207-20020a632ad8000000b0046ebb8eb343mr39748336pgq.408.1667763165250; Sun, 06 Nov 2022 11:32:45 -0800 (PST) Received: from [10.0.2.15] ([27.57.114.71]) by smtp.gmail.com with ESMTPSA id c17-20020a170902d49100b001754cfb5e21sm3468092plg.96.2022.11.06.11.32.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 06 Nov 2022 11:32:44 -0800 (PST) Message-ID: Date: Mon, 7 Nov 2022 01:02:41 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: Todo item: distinct clause - guidance To: Laurenz Albe , pgsql-novice@lists.postgresql.org References: Content-Language: en-US From: Ankit Kumar Pandey In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 07/11/22 00:42, Laurenz Albe wrote: > On Sun, 2022-11-06 at 18:39 +0530, Ankit Kumar Pandey wrote: >> I was looking for some to-do item to pick up and came across 'Implement DISTINCT >> clause in window aggregates'. Can someone pleaseelaborate what is expectation here? >> Do feature request still exists as DISTINCT worked as expected if we try functions >> like avg(distinct col)? > Whis is about window functions, like > > WITH q(a,b) AS (VALUES (1, 1), (1, 1), (2, 1)) > SELECT *, > count(DISTINCT a) OVER (PARTITION BY b) > FROM q; > > ERROR: DISTINCT is not implemented for window functions > LINE 3: count(DISTINCT a) OVER (PARTITION BY b) > ^ > > Yours, > Laurenz Albe Thanks a lot Laurenz, I got the issue now. I was looking at aggregation function without windowing. I will revisit this again. Thanks, Ankit