Re: CONCAT function adding extra characters

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: 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:07:30
Message-ID: 675f0952-cca1-2e8a-b0fe-ad36ca4f3548@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 6/15/21 11:55 AM, AI Rumman wrote:
> 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?

Aah, too quick on the trigger.

Also:

Is there a home brewed version of CONCAT() in the search_path?

>
> Thanks.

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2021-06-15 19:07:41 Re: CONCAT function adding extra characters
Previous Message Adrian Klaver 2021-06-15 19:05:56 Re: CONCAT function adding extra characters