Re: CONCAT function adding extra characters
От | Pavel Stehule |
---|---|
Тема | Re: CONCAT function adding extra characters |
Дата | |
Msg-id | CAFj8pRDb4MevTh5kV7hsXbX9hszCt3Ca8hRrCOdOp9ag5H3HyQ@mail.gmail.com обсуждение исходный текст |
Ответ на | CONCAT function adding extra characters (AI Rumman <rummandba@gmail.com>) |
Ответы |
Re: CONCAT function adding extra characters
|
Список | pgsql-general |
Hi
út 15. 6. 2021 v 20:56 odesílatel AI Rumman <rummandba@gmail.com> napsal:
I am using Postgresql 10 and seeing a strange behavior in CONCAT function when I am concatenating double precision and int with a separator.select concat('41.1'::double precision,':', 20);
Result:
41.1000000000000014:20
Value 41.1 which double precision converts to 41.1000000014.
Is that expected?
this is strange
postgres=# select concat('41.1'::double precision,':', 20);
┌─────────┐
│ concat │
╞═════════╡
│ 41.1:20 │
└─────────┘
(1 row)
postgres=# select version();
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ version │
╞═══════════════════════════════════════════════════════════════════════════════════════════════════════════╡
│ PostgreSQL 10.17 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.1.1 20210428 (Red Hat 11.1.1-1), 64-bit │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────┘
(1 row)
┌─────────┐
│ concat │
╞═════════╡
│ 41.1:20 │
└─────────┘
(1 row)
postgres=# select version();
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ version │
╞═══════════════════════════════════════════════════════════════════════════════════════════════════════════╡
│ PostgreSQL 10.17 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.1.1 20210428 (Red Hat 11.1.1-1), 64-bit │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────┘
(1 row)
Regards
Pavel
Thanks.
В списке pgsql-general по дате отправления: