| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp> |
| Cc: | pgsql-general <pgsql-general(at)postgresql(dot)org>, Thomas Lockhart <lockhart(at)fourpalms(dot)org> |
| Subject: | Re: infinity as a date |
| Date: | 2002-12-12 05:13:28 |
| Message-ID: | 3245.1039670008@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp> writes:
> I see that Postgres has a special keyword "infinity" for use with
> timestamps. Is there an equivalent for dates?
There is not.
> I tried the following but it doesn't quite work:
> JC=# create table test(a date);
> CREATE TABLE
> JC=# insert into test values('infinity'::timestamp);
> INSERT 1030323 1
> JC=# select * from test;
> a
> ---
> (1 row)
It appears that what actually gets stored in test.a is NULL ... which
is not surprising given the source code for timestamp_date():
if (TIMESTAMP_NOT_FINITE(timestamp))
PG_RETURN_NULL();
I think that this is an outright bug: if type DATE doesn't have a
concept of infinity then it should throw an error, not translate
infinity to NULL. NULL means "unknown", not "I cannot cope with this
value".
Comments?
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2002-12-12 05:28:40 | Re: Urgent need of (paid) PostgreSQL support in New |
| Previous Message | Joshua D. Drake | 2002-12-12 05:09:23 | Re: Potentially serious migration issue from 7.1.3 to 7.2 |