timestamptz & 'infinity' & date

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: General PostgreSQL List <pgsql-general(at)postgresql(dot)org>
Subject: timestamptz & 'infinity' & date
Date: 2008-01-01 06:11:43
Message-ID: 359338.5932.qm@web31807.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am getting a little confused in casting 'infinity'.

It seems that 'infinity' still can't be casted to a date. :-(

But I tried the following casts, but I am not sure the results are consistent.

instrumentation=> SELECT 'infinity'::date;
ERROR: invalid input syntax for type date: "infinity"

instrumentation=> SELECT 'infinity'::timestamptz;
timestamptz
-------------
infinity
(1 row)

instrumentation=> SELECT 'infinity'::timestamptz::date;
date
------
<-- this blank I determine was a NULL.
(1 row)

Is this correct? Shouldn't it also return an error?

Regards,
Richard Broersma Jr.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-01-01 07:11:27 Re: timestamptz & 'infinity' & date
Previous Message D. Dante Lorenso 2008-01-01 04:21:25 Re: Problem with index when using function