Re: Exponential notation bug

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Marcos Pegoraro <marcos(at)f10(dot)com(dot)br>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Exponential notation bug
Date: 2025-04-04 16:14:08
Message-ID: CA+TgmoaK2ksBUoCVwwOd1LfmeNVNXtH27KzeyHVhgsobZPo6_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Apr 4, 2025 at 11:55 AM Marcos Pegoraro <marcos(at)f10(dot)com(dot)br> wrote:
> I was deleting thousands of records each time with \gexec, then ...
>
> This one works
> select format('delete from table where ID = any(%L::integer[]);', array_agg(ID)), (ord-1)/10000 from (
> select * from generate_series(15e2,65e5) with ordinality) x(ID, ord) group by 2 order by 2;
>
> But it's easier to write in exponential notation, so I changed this (ord-1)/10000 to (ord-1)/1e4. Using this way exponential notation is just ignored.

This seems like a question for -general or some other user-focused
mailing list, not hackers. At any rate, I don't see how 1e4 could just
be "ignored", but as Maciek points out, 1e4 and 10000 are of different
data types, which seems likely to be relevant somehow.

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2025-04-04 16:17:19 Re: autoprewarm_dump_now
Previous Message Maciek Sakrejda 2025-04-04 16:12:54 Re: Exponential notation bug