Text to interval conversion can silently truncate data

Поиск
Список
Период
Сортировка
От Jack Christensen
Тема Text to interval conversion can silently truncate data
Дата
Msg-id 55944DCE.4090601@jackchristensen.com
обсуждение исходный текст
Ответы Re: Text to interval conversion can silently truncate data  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
jack=# select '1.51 years'::interval = '1.52 years'::interval;
 ?column?
----------
 t
(1 row)

This is surprising. Once I looked at the C code for Interval it makes more sense given that it cannot represent fractional years, months, or days. Wouldn't it make more sense to raise an invalid input error than to silently truncate data?

Jack

В списке pgsql-general по дате отправления:

Предыдущее
От: Arthur Silva
Дата:
Сообщение: Re: Which replication is the best for our case ?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Text to interval conversion can silently truncate data