Precision/scale of a numeric attribute of a new data type are nothandled correctly when the type is returned by a function - Mailing list pgsql-bugs

From Petr Fedorov
Subject Precision/scale of a numeric attribute of a new data type are nothandled correctly when the type is returned by a function
Date
Msg-id b2dbfbd0-8f12-4cca-a0b5-9ee3f00385b4@phystech.edu
Whole thread Raw
Responses Re: Precision/scale of a numeric attribute of a new data type are not handled correctly when the type is returned by a function
List pgsql-bugs
Hello,

Steps to reproduce:


create type public.test_type as (  value1 numeric(35,6),     value2
numeric(35,6) );

create or replace function public.test(    )    returns test_type   
language  'sql'  as $body$   select 7.136178319899999964,
7.136178319899999964;  $body$;


select value1, value2 from test();

Expected:  7.136178 7.136178

Actual:  7.136178319899999964 7.136178319899999964


select value1::numeric(35,6), value2::numeric(35,2) from test();

Expected:  7.136178 7.14

Actual: 7.136178319899999964 7.14


I'm on Centos 7,  Postgresql 11.6



   





pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #16134: Assertion fails on CREATE gist INDEX over intarray
Next
From: Tom Lane
Date:
Subject: Re: BUG #16134: Assertion fails on CREATE gist INDEX over intarray