Re: How to implement GOMONTH function - Mailing list pgsql-general

From Andrus
Subject Re: How to implement GOMONTH function
Date
Msg-id f3ke7k$ef7$1@news.hub.org
Whole thread Raw
In response to Re: How to implement GOMONTH function  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: How to implement GOMONTH function
List pgsql-general
>> Why numeric(2) is not casted to integer automatically ?
>
> Because it would lose data, eg '4.4' being rounded to 4.

create temp table test ( test numeric(2));
insert into test values (0.5);
select * from test

returns

1


I'm really confused now.

I tought that numeric(2) can store only integer data, without decimal
points.

Can you give example how   numeric(2) -> integer conversion can  lose data,
please.


Andrus.


pgsql-general by date:

Previous
From: Lew
Date:
Subject: Re: problems with SELECT query results
Next
From: Richard Huxton
Date:
Subject: Re: current transaction is aborted, commands ignored until end of transaction block