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

From Tom Lane
Subject Re: How to implement GOMONTH function
Date
Msg-id 22019.1180563266@sss.pgh.pa.us
Whole thread Raw
In response to Re: How to implement GOMONTH function  ("Andrus" <kobruleht2@hot.ee>)
List pgsql-general
"Andrus" <kobruleht2@hot.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Full vacuum may reclaim space
Next
From: Ben
Date:
Subject: Re: DRDB risk factors?