From: | "Mark Wilson" <mark(at)mediasculpt(dot)com> |
---|---|
To: | "Jean-Christian Imbeault" <jc(at)mega-bucks(dot)co(dot)jp> |
Cc: | "pgsql-general" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: infinity as a date |
Date: | 2002-12-11 19:58:02 |
Message-ID: | 011501c2a14f$a080f750$3301a8c0@merl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)mega-bucks(dot)co(dot)jp>
To: "Jean-Christian Imbeault" <jc(at)mega-bucks(dot)co(dot)jp>
Cc: "pgsql-general" <pgsql-general(at)postgresql(dot)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(at)postgresql(dot)org)
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Samuel J. Sutjiono | 2002-12-11 20:15:47 | Re: Recovery Mode |
Previous Message | Justin Clift | 2002-12-11 19:57:47 | Re: Recovery Mode |