Search Postgresql Archives

Re: CONCAT function adding extra characters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I saw that problem when I was running the query from DBeaver. 
Got my answer.

Thanks & Regards.

On Tue, Jun 15, 2021 at 12:18 PM Pavel Stehule <pavel.stehule@xxxxxxxxx> wrote:


út 15. 6. 2021 v 21:07 odesílatel Tom Lane <tgl@xxxxxxxxxxxxx> napsal:
AI Rumman <rummandba@xxxxxxxxx> writes:
> 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

What have you got extra_float_digits set to?


postgres=# set extra_float_digits to 3;
SET
postgres=# select concat('41.1'::double precision,':', 20);
┌────────────────────────┐
│         concat         │
╞════════════════════════╡
│ 41.1000000000000014:20 │
└────────────────────────┘
(1 row)

Pavel

 
                        regards, tom lane



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux