Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xATYz-00000002fUV-1Fj7 for pgsql-bugs@arkaria.postgresql.org; Sat, 26 Sep 2026 14:39:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xATYy-00000004Sxp-157V for pgsql-bugs@arkaria.postgresql.org; Sat, 26 Sep 2026 14:39:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xATYx-00000004Sxg-4BlV for pgsql-bugs@lists.postgresql.org; Sat, 26 Sep 2026 14:39:40 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xATYv-00000001Mc7-2Sbr for pgsql-bugs@lists.postgresql.org; Sat, 26 Sep 2026 14:39:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 68QEdZqw2160452; Sat, 26 Sep 2026 10:39:36 -0400 From: Tom Lane To: 1482694023@qq.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19722: Window PARTITION BY numeric treats equal values with different scales as separate partitions In-reply-to: <19722-1b775eae8675c158@postgresql.org> References: <19722-1b775eae8675c158@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Sat, 26 Sep 2026 08:55:20 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2160450.1790433575.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 26 Sep 2026 10:39:35 -0400 Message-ID: <2160451.1790433575@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > CREATE TEMP TABLE decimal_source (raw_value text NOT NULL); > INSERT INTO decimal_source VALUES > ('1.0'), ('1.00'), ('1.000'); > SELECT amount, partition_size > FROM ( > SELECT raw_value::numeric AS amount, > COUNT(*) OVER (PARTITION BY raw_value::numeric) AS partition_= size > FROM decimal_source > ) AS windowed > WHERE scale(amount) =3D 1; This is a near-duplicate of many recent reports[1][2][3][4][5]. Not one of them has offered a reason why they think that testing scale() of a grouped numeric column is a useful or even well-defined thing to do. Do you have a real-world use case? What is it? regards, tom lane [1] https://www.postgresql.org/message-id/flat/CA%2BCOZaA0tnyza0pHx6-UEdM5= dcLGP4RJJ0KOHFq%2BwVQCY2Jyiw%40mail.gmail.com [2] https://www.postgresql.org/message-id/flat/19588-e32b82433b3660ea%40po= stgresql.org [3] https://www.postgresql.org/message-id/flat/19619-fc646db1c6b2dc90%40po= stgresql.org [4] https://www.postgresql.org/message-id/flat/19697-6e7ccba388bbe858%40po= stgresql.org [5] https://www.postgresql.org/message-id/flat/19713-635b8656d07464df%40po= stgresql.org