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 1orl4w-0005ou-M2 for pgsql-novice@arkaria.postgresql.org; Sun, 06 Nov 2022 19:13:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1orl4v-0004EB-DV for pgsql-novice@arkaria.postgresql.org; Sun, 06 Nov 2022 19:13:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1orl4v-0004E1-1S for pgsql-novice@lists.postgresql.org; Sun, 06 Nov 2022 19:13:09 +0000 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1orl4o-0000ht-Dc for pgsql-novice@lists.postgresql.org; Sun, 06 Nov 2022 19:13:07 +0000 Received: by mail-ej1-x62a.google.com with SMTP id q9so25228627ejd.0 for ; Sun, 06 Nov 2022 11:13:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=xITod40JHEmzpnp8OPbV8gXiXqlBjD+5iK7P0Wzk4nU=; b=Yt7C2uLYTP4hzApe8lEqLUQNArSoEj8ENtx+HGmgQX5tDsi2A2f/oaeQ4C1vcs9mK+ 5EmHPDNjxlXxziLIu9n04zvTxbF9M26CnUs/gaCiDSjsq23iN5YyWbx2OtrmJYxmeMvZ 4TqQF1iRuvH1Qf609p7I4BPcJqvERaSP09cEQrgw4mPLve4KLJpHDYZ8JPuPg6SxXE8x S2iS/zHSnOIcU/3swejKZnuiSix+XtFNrig/RSE3pVPiv6AB1XA+YECd1FGBb4rRMReJ CXWjDBSdiMemq3YoTrcRlJw0agn8MI9Tr0TUuKsDJ2Kx/0hqnrif+vwLCJ12Ec6wUFZn NcsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=xITod40JHEmzpnp8OPbV8gXiXqlBjD+5iK7P0Wzk4nU=; b=Kxy8XXoA/en2SEtA5pot3FxaPze7Hv2Ir5OafKDTrmEEmuf0avS0Y5sorRoR0ZKi1N isqj40DM4EhL0bcZHpU+fxofpduHJa/w/JWSk6RyxOBoRii8mCZlaGZKOU4FjQ37Vazt CLtc+2L3uhlPYxC3eSIylKU/Xgfk7tSrGuMYyWQKnqL/ohTftlB2hnt1vovAu3JorySz QhlMieqrwW4qqLoWiOMddDfpszPtCSvyBDMeKZgayUAIojpkWohuDgZ2DL6XwO40fdui 31/+H9zqXh22dGLORmnLodtwK1tldd0AewECNna5Q9EjcmHsjsyAhmlysKvsSMCbf5Po Bkkg== X-Gm-Message-State: ACrzQf3uApj/Zn5YilOKSG9Y/pHZK9JjDmB//i7K6k8Se+xgiMYfiCNg 0/PR7sJ0GboOwY/oLVIqLE/4eXOhzz2hcA== X-Google-Smtp-Source: AMsMyM7EXwevZq8UWwukRGl5eZtZbvGp8flapgcI1AhKwx4NRBO5k68C1n8qrJnlL8RwZNDcgEaTUw== X-Received: by 2002:a17:906:79d8:b0:7ad:b675:f34d with SMTP id m24-20020a17090679d800b007adb675f34dmr41194953ejo.194.1667761979882; Sun, 06 Nov 2022 11:12:59 -0800 (PST) Received: from localhost.localdomain (178-190-182-92.adsl.highway.telekom.at. [178.190.182.92]) by smtp.gmail.com with ESMTPSA id e4-20020a170906314400b007836d075152sm2367102eje.187.2022.11.06.11.12.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Nov 2022 11:12:59 -0800 (PST) Message-ID: Subject: Re: Todo item: distinct clause - guidance From: Laurenz Albe To: Ankit Kumar Pandey , pgsql-novice@lists.postgresql.org Date: Sun, 06 Nov 2022 20:12:58 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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