Re: 'infinity'::Interval should be added

Поиск
Список
Период
Сортировка
От Isaac Morland
Тема Re: 'infinity'::Interval should be added
Дата
Msg-id CAMsGm5f_3_w68hiiohDqhwrWvbY-6KRd5gYnNFCZgTkDEaW8dg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: 'infinity'::Interval should be added  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Sun, 16 Dec 2018 at 22:27, Robert Haas <robertmhaas@gmail.com> wrote:
 
Simon's argument for adding this is that we support 'infinity' for
timestamp, but is that a good argument for making 'interval' do it,
given that there are many other types like date for which we don't
support it?

postgres=> select 'infinity'::date, '-infinity'::date;
   date   |   date    
----------+-----------
 infinity | -infinity
(1 row)

postgres=> 

Works since 8.4:


I think that in principle an argument can be made for having infinity and -infinity in every data type, sort of like how every data type has null, but based on the nature of the system as it exists I'm not going to advance that argument.

I do think that decimal/numeric probably ought to have infinity, assuming there is a reasonable way to fit them into the representation, but integer types are currently exactly 2/4/8-byte 2's complement values so I don't see how to squeeze in infinite values in a way that wouldn't mess up existing code (or cause handling of integer values to be much slower).

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: 'infinity'::Interval should be added
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: ALTER INDEX ... ALTER COLUMN not present in dump