Re: infinity as a date

Поиск
Список
Период
Сортировка
От Mark Wilson
Тема Re: infinity as a date
Дата
Msg-id 011501c2a14f$a080f750$3301a8c0@merl
обсуждение исходный текст
Ответ на infinity as a date  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
Список 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 по дате отправления:

Предыдущее
От: Justin Clift
Дата:
Сообщение: Re: Recovery Mode
Следующее
От: "Samuel J. Sutjiono"
Дата:
Сообщение: Re: Recovery Mode