Re: Why overlaps is not working - Mailing list pgsql-general

From Andrus
Subject Re: Why overlaps is not working
Date
Msg-id 003b01c705d1$71959280$6207eb50@acer
Whole thread Raw
In response to Re: Why overlaps is not working  (Matthias.Pitzl@izb.de)
Responses Re: Why overlaps is not working
List 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.


pgsql-general by date:

Previous
From: "Andrus"
Date:
Subject: Re: Why overlaps is not working
Next
From: "Andrus"
Date:
Subject: Re: Why overlaps is not working