bug: select date 'infinity' gives error

Поиск
Список
Период
Сортировка
Искать

bug: select date 'infinity' gives error

От:
Jean-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?


Re: bug: select date 'infinity' gives error

От:
Jean-Christian Imbeault <jc@mega-bucks.co.jp>
Дата:
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

Re: bug: select date 'infinity' gives error

От:
Jean-Christian Imbeault <jc@mega-bucks.co.jp>
Дата:
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

Re: bug: select date 'infinity' gives error

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Jean-Christian Imbeault  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
FAQ