Re: How to implement GOMONTH function

Поиск
Список
Период
Сортировка
От Andrus
Тема Re: How to implement GOMONTH function
Дата
Msg-id f3ke7k$ef7$1@news.hub.org
обсуждение исходный текст
Ответ на Re: How to implement GOMONTH function  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: How to implement GOMONTH function  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Lew
Дата:
Сообщение: Re: problems with SELECT query results
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: current transaction is aborted, commands ignored until end of transaction block