Re: CONCAT function adding extra characters

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: AI Rumman <rummandba(at)gmail(dot)com>, pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: CONCAT function adding extra characters
Date: 2021-06-15 19:18:15
Message-ID: CAFj8pRD_7ENdgkSZv6ARFUnixMFrp7Y=C2ffEVCwf-M9FyCkzQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

út 15. 6. 2021 v 21:07 odesílatel Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> napsal:

> AI Rumman <rummandba(at)gmail(dot)com> 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
>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2021-06-15 20:14:16 Re: CONCAT function adding extra characters
Previous Message Kenneth Marshall 2021-06-15 19:12:51 Re: CONCAT function adding extra characters