Re: How to implement GOMONTH function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Andrus" <kobruleht2(at)hot(dot)ee>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to implement GOMONTH function
Date: 2007-05-30 22:14:26
Message-ID: 22019.1180563266@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Andrus" <kobruleht2(at)hot(dot)ee> writes:
>>> Why numeric(2) is not casted to integer automatically ?
>>
>> Because it would lose data, eg '4.4' being rounded to 4.

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

Oh, I see your confusion: you're supposing that we might make different
casting decisions about numeric(2) than, say, numeric(2,1). Sorry,
it doesn't work that way. The base data type is all that is used
to determine the applicability of casts (or any other function).

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ben 2007-05-30 22:20:18 Re: DRDB risk factors?
Previous Message Tom Lane 2007-05-30 22:11:33 Re: Full vacuum may reclaim space