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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-general by date

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