bug: select date 'infinity' gives error

Started by Jean-Christian Imbeaultover 23 years ago4 messagesgeneral
Jump to latest
#1Jean-Christian Imbeault
jc@mega-bucks.co.jp

According to the docs at
http://www.postgresql.org/idocs/index.php?datatype-datetime.html,
'infinity' is a valid date input. I quote:

"The following SQL-compatible functions can be used as date or time
input ... 'infinity' [...]"

but I get the following error when trying to set a date to infinity ...

$ psql DB -c "select date 'infinity'"
ERROR: Unrecognized date external representation 'infinity'

whereas it works as as a timestamp ...

$ psql DB -c "select timestamp 'infinity'"
timestamptz
-------------
infinity
(1 row)

Is my syntax wrong?

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jean-Christian Imbeault (#1)
Re: bug: select date 'infinity' gives error

Jean-Christian Imbeault <jc@mega-bucks.co.jp> writes:

According to the docs at
http://www.postgresql.org/idocs/index.php?datatype-datetime.html,
'infinity' is a valid date input.

This is a documentation bug.

regards, tom lane

#3Jean-Christian Imbeault
jc@mega-bucks.co.jp
In reply to: Jean-Christian Imbeault (#1)
Re: bug: select date 'infinity' gives error

Tom Lane wrote:

This is a documentation bug.

Oops, forgot to ask, should I submit a bug report? Or have you taken
care of that already?

Jc

#4Jean-Christian Imbeault
jc@mega-bucks.co.jp
In reply to: Jean-Christian Imbeault (#1)
Re: bug: select date 'infinity' gives error

Tom Lane wrote:

This is a documentation bug.

Shucks ...

Is there a way to get an equivalent to infinity for a date?

Also, what is the correct way to typecast? I have seen this version
"x::data_type" and also while researching infinity for dates
"timestamp'infinity'".

Is timstamp'infinity' type-casting, or a function call, or ...?

Thanks,

Jc