Re: Strange results when casting string to double

Поиск
Список
Период
Сортировка
От Peter J. Holzer
Тема Re: Strange results when casting string to double
Дата
Msg-id 20220218214249.su6x5hi6ixauggku@hjp.at
обсуждение исходный текст
Ответ на Re: Strange results when casting string to double  (Carsten Klein <c.klein@datagis.com>)
Ответы Re: Strange results when casting string to double  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Strange results when casting string to double  (Tomas Pospisek <tpo2@sourcepole.ch>)
Список pgsql-general
On 2022-02-18 18:07:35 +0100, Carsten Klein wrote:
> both PostgreSQL and my C program are linked to the same libc.so.6. Same
> path, same MD5 sum. Since libc is a Shared Object (so), both processes
> should really run the identical code. Am I missing something? I've written
> and compiled the small C program on the same old Ubuntu OS.
[...]
> PostgreSQL is up for more than 480 days on that server. I'm thinking of
> giving a restart of the database a try. However, there's a long running
> import taking place, so this will not happen before mid or end of next week.

If there has been a glibc update (or a postgresql update) in those 480
days (Ubuntu 14.04 is out of its normal maintenance period but ESM is
still available) the running processes may well run different code than
a newly started program. So it could be a bug which has since been
fixed.

Another idea: It could be the case that something (maybe a bug in
postgres, maybe an extension, maybe even a random bit flip in memory)
changed the FP rounding mode within the postgres process, which would
affect all FP computations until the rounding mode is reset. That would
have to have happened in the master to affect the worker processes as
consistently as you are seeing. I don't know if it is even possible for
a non-standard rounding mode to persist for any length of time, but if
it is it would certainly account for weird rounding errors.

        hp

--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Strange results when casting string to double
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Strange results when casting string to double