Skip site navigation (1) Skip section navigation (2)

Re: How to implement GOMONTH function

From: "Andrus" <kobruleht2(at)hot(dot)ee>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to implement GOMONTH function
Date: 2007-05-30 17:33:36
Message-ID: f3ke7k$ef7$1@news.hub.org (view raw or flat)
Thread:
Lists: 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.


In response to

Responses

pgsql-general by date

Next:From: Richard HuxtonDate: 2007-05-30 17:34:29
Subject: Re: Problem - any password accepted
Previous:From: Merlin MoncureDate: 2007-05-30 17:31:00
Subject: Re: hundreds of schema vs hundreds of databases

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group