Re: infinity as a date - Mailing list pgsql-general

From Mark Wilson
Subject Re: infinity as a date
Date
Msg-id 011501c2a14f$a080f750$3301a8c0@merl
Whole thread Raw
In response to infinity as a date  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
List pgsql-general
I've just executed that code and the single row in the table contains null,
not infinity.

  insert into test values('infinity'::timestamp);
  select * from test where a > now();
will return no rows.

Of course, this is no use if you want the field to be part of your primary
key.

----- Original Message -----
From: "Jean-Christian Imbeault" <jc@mega-bucks.co.jp>
To: "Jean-Christian Imbeault" <jc@mega-bucks.co.jp>
Cc: "pgsql-general" <pgsql-general@postgresql.org>
Sent: Thursday, December 12, 2002 2:14 AM
Subject: Re: [GENERAL] infinity as a date


> Bruno Wolff III wrote:
>  >
>  > Dates cannot have a value of 'infinity'. Either you can store
timestamps
>  > instead of dates or use another column to indicate to indicate the date
>  > is infinite and have your tests check that column as well as the date
>  > column.
>
> Ok, so why does postgres let me get away with:
>
> JC=# create table test(a date);
> CREATE TABLE
> JC=# insert into test values('infinity'::timestamp);
> INSERT 1030323 1
>
> If dates cannot hvae a value of infinity why can I insert 'infinity'
> into a date field?
>
> Should not postgres throw an error?
>
> Jc
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
>


pgsql-general by date:

Previous
From: Justin Clift
Date:
Subject: Re: Recovery Mode
Next
From: "Samuel J. Sutjiono"
Date:
Subject: Re: Recovery Mode