BUG #18977: Unexpected result of function to_char

Поиск
Список
Период
Сортировка
От PG Bug reporting form
Тема BUG #18977: Unexpected result of function to_char
Дата
Msg-id 18977-b301735f4ecad02f@postgresql.org
обсуждение исходный текст
Ответы Re: BUG #18977: Unexpected result of function to_char
Re: BUG #18977: Unexpected result of function to_char
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      18977
Logged by:          Chi Zhang
Email address:      798604270@qq.com
PostgreSQL version: 18beta1
Operating system:   ubuntu 24.04 with docker
Description:

hi,
the following two queries are equivalent but return different results:
```
SELECT ((to_char(-1E30, '0.9930824')));
  to_char
------------
 -#.##3#824
(1 row)
PREPARE prepare_query (float8) AS SELECT ((to_char($1, '0.9930824')));
EXECUTE prepare_query(-1E30::float8);
 to_char
---------
 -#.
```
furthermore, it seems the second argument of to_chat is formatted, but
according to the document in
https://www.postgresql.org/docs/current/functions-formatting.html, it should
be the first argument to be formatted


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