On Sun, 16 Dec 2018 at 22:27, Robert Haas <robertmh...@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:

https://www.postgresql.org/docs/8.4/datatype-datetime.html

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).

Reply via email to