'Infinity' in date columns? - Mailing list pgsql-general

From Ken Winter
Subject 'Infinity' in date columns?
Date
Msg-id 37572C547879461AAF40CC2DA8773516@KenIBM
Whole thread Raw
Responses Re: 'Infinity' in date columns?
Re: 'Infinity' in date columns?
List pgsql-general

The documentation at http://www.postgresql.org/docs/8.3/static/datatype-datetime.html seems to say that the special value ‘infinity’ (“later than all other time stamps”) should work for an date-time column, and the type “date” is listed as among the date-time data types.

 

But I can’t get ‘infinity’ to work for columns of type “date”.

 

Here’s a test case:

 

CREATE TABLE _test

(

  timestampx timestamp without time zone DEFAULT 'infinity'::timestamp without time zone,

  datex date DEFAULT 'infinity'::timestamp without time zone

)

);

 

INSERT INTO _test DEFAULT VALUES;

 

SELECT * FROM _test;

 

This returns (as viewed through pgAdmin III):

 

timestampx     datex

-----------     -----

infinity

 

When I tried to declared the “datex” column like this:

 

  datex date DEFAULT 'infinity'::date

 

I got this:

 

ERROR:  invalid input syntax for type date: "infinity"

 

Is there any way to get ‘infinity’ to work for a “date” column? 

 

Or any other way to get the equivalent functionality in a date column?

 

~ TIA

~ Ken

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Why Performance of SQL Query is *much* Slower in GUI PgAdmin
Next
From: Shoaib Mir
Date:
Subject: Re: 'Infinity' in date columns?