agora inbox for pgsql-bugs@postgresql.org
help / color / mirror / Atom feedFrom: Tom Lane <tgl@sss.pgh.pa.us>
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
Date: Sat, 26 Sep 2026 10:39:35 -0400
Message-ID: <2160451.1790433575@sss.pgh.pa.us> (raw)
In-Reply-To: <19722-1b775eae8675c158@postgresql.org>
References: <19722-1b775eae8675c158@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> 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) = 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-UEdM5dcLGP4RJJ0KOHFq%2BwVQCY2Jyiw%4...
[2] https://www.postgresql.org/message-id/flat/19588-e32b82433b3660ea%40postgresql.org
[3] https://www.postgresql.org/message-id/flat/19619-fc646db1c6b2dc90%40postgresql.org
[4] https://www.postgresql.org/message-id/flat/19697-6e7ccba388bbe858%40postgresql.org
[5] https://www.postgresql.org/message-id/flat/19713-635b8656d07464df%40postgresql.org
view thread (2+ messages)
Message-ID: <2160451.1790433575@sss.pgh.pa.us>
Permalink: ../2160451.1790433575@sss.pgh.pa.us/
Also on: postgresql.org/message-id/2160451.1790433575@sss.pgh.pa.us
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, 1482694023@qq.com, 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: <2160451.1790433575@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox