timestamptz & 'infinity' & date

Started by Richard Broersma Jrover 18 years ago2 messagesgeneral
Jump to latest
#1Richard Broersma Jr
rabroersma@yahoo.com

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.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Richard Broersma Jr (#1)
Re: timestamptz & 'infinity' & date

Richard Broersma Jr <rabroersma@yahoo.com> writes:

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

It's still on the TODO list.

regards, tom lane