Re: Why overlaps is not working

From: "Andrus" <eetasoft(at)online(dot)ee>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Why overlaps is not working
Date: 2006-11-11 20:32:06
Message-ID: 003b01c705d1$71959280$6207eb50@acer
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>> In my application second and fourth parameters can be NULL which means
>> forever.
>
> No it doesn't. NULL means "unknown". You're just using it to represent
> "forever".

My table represents employee absence starting and ending dates.
If end day is not yet known, it is represented by NULL value.
My query should threat unknown value as never ending absence to return
estimated number of work days.

Infinity date value is missing in SQL standard.
I do'nt know any other good way to represent missing ending date.

> There is a value "infinity" for timestamps, but unfortunately not for
> dates. Otherwise, I'd suggest that you use that instead.

I tried to use

timestamp 'infinity':: date

but this does not work if both b and d are infinity since

select timestamp 'infinity':: date<=timestamp 'infinity':: date

returns null.

Andrus.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message novnov 2006-11-11 22:00:01 Speed of postgres compared to ms sql, is this article/comment off?
Previous Message Andrus 2006-11-11 20:26:33 Re: Why overlaps is not working