On 2018-10-18 18:58:13 -0400, Tom Lane wrote:
> "Peter J. Holzer" writes:
> > On 2018-10-18 10:15:40 -0400, Tom Lane wrote:
> >> You could ju-jitsu the system into duplicating that behavior by casting
> >> to text (which invokes float4out) and then to numeric:
>
> > I suggest casting first to flo
"Peter J. Holzer" writes:
> On 2018-10-18 10:15:40 -0400, Tom Lane wrote:
>> You could ju-jitsu the system into duplicating that behavior by casting
>> to text (which invokes float4out) and then to numeric:
> I suggest casting first to float8 and then to numeric. The conversion
> from float4 to f
On 2018-10-18 10:15:40 -0400, Tom Lane wrote:
> Alessandro Aste writes:
> > I need to convert an SQL field from real to numeric, but I’m getting a
> > strange behavior.
> > select amount, amount::numeric, amount::numeric(16,4),
> > amount::varchar::numeric from mytable where id = 32560545;
> > Res
Alessandro Aste writes:
> I need to convert an SQL field from real to numeric, but I’m getting a
> strange behavior.
> select amount, amount::numeric, amount::numeric(16,4),
> amount::varchar::numeric from mytable where id = 32560545;
> Result:
> 17637.75, 17637.8, 17637.8000, 17637.75
You realiz
On 10/18/18 3:28 AM, Alessandro Aste wrote:
Hi,
Postresql version: 10.5
I need to convert an SQL field from real to numeric, but I’m getting a
strange behavior.
See the following query in preprod:
select amount, amount::numeric, amount::numeric(16,4),
amount::varchar::numeric from mytabl
Hi,
Postresql version: 10.5
I need to convert an SQL field from real to numeric, but I’m getting a
strange behavior.
See the following query in preprod:
select amount, amount::numeric, amount::numeric(16,4),
amount::varchar::numeric from mytable where id = 32560545;
Result:
17637.75