Re: Feature or bug: getting "Inf"::timestamp[tz] by "regular" value

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vitaly Burovoy <vitaly(dot)burovoy(at)gmail(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Feature or bug: getting "Inf"::timestamp[tz] by "regular" value
Date: 2015-11-18 14:35:09
Message-ID: 12114.1447857309@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Vitaly Burovoy <vitaly(dot)burovoy(at)gmail(dot)com> writes:
> I'm writing another patch for timestamps and while I tried to cover
> corner-cases I found out there is an ability to get
> "Infinity"::timestamptz via defining it by a specific (but not
> "Infinity") value:
> postgres=# SELECT '294277-01-09 04:00:54.775807+00'::timestamptz; -- Inf???
> timestamptz
> -------------
> infinity
> (1 row)

> I could not find a way to get "-Infinity" by similar way.
> Is it feature or a bug?

It's a bug. Probably related to the fact that "Infinity" is represented
as INT_MAX in the case of integer timestamps.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-11-18 15:20:56 Re: Bug in numeric multiplication
Previous Message Thom Brown 2015-11-18 13:54:47 Re: [COMMITTERS] pgsql: Add pg_audit, an auditing extension