Re: 'Infinity' in date columns?

From: Shoaib Mir <shoaibmir(at)gmail(dot)com>
To: Ken Winter <ken(at)sunward(dot)org>
Cc: PostgreSQL pg-general List <pgsql-general(at)postgresql(dot)org>
Subject: Re: 'Infinity' in date columns?
Date: 2010-05-17 04:18:13
Message-ID: AANLkTindLS-mt01aebrIQHRTZwrPRaIPriz8XMNCKqN-@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, May 17, 2010 at 1:17 PM, Ken Winter <ken(at)sunward(dot)org> wrote:

> 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”.
>
>
>
I don't have version 8.3 with me right now but I just gave it a try with 8.4
and it gave me the expected output:

postgres=# CREATE TABLE _test
postgres-# (
postgres(# timestampx timestamp without time zone DEFAULT
'infinity'::timestamp without time zone,
postgres(# datex date DEFAULT 'infinity'::timestamp without time zone
postgres(# );
CREATE TABLE
postgres=# INSERT INTO _test DEFAULT VALUES;
INSERT 0 1
postgres=# SELECT * FROM _test;
timestampx | datex
------------+----------
infinity | infinity
(1 row)

postgres=# select version();
version

--------------------------------------------------------------------------------------------------
PostgreSQL 8.4.3 on i686-pc-linux-gnu, compiled by GCC gcc (Ubuntu
4.4.1-4ubuntu9) 4.4.1, 32-bit
(1 row)

--
Shoaib Mir
http://shoaibmir.wordpress.com/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-05-17 04:21:57 Re: 'Infinity' in date columns?
Previous Message Ken Winter 2010-05-17 03:17:34 'Infinity' in date columns?