Re: FWD: overlaps() bug?

From: Thomas Lockhart <lockhart(at)fourpalms(dot)org>
To: "PATTERSON,JEFF (A-Sonoma,ex1)" <jeff_patterson(at)agilent(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: FWD: overlaps() bug?
Date: 2002-02-16 01:53:00
Message-ID: 3C6DBB7C.84A4F7CC@fourpalms.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

...
> Specs are a good thing and should be adhered to. We should not however
> blindly follow them off a cliff.

Right.

> If a function can not be implemented that both
> follows the spec and gives the right answer then IMHO the function should
> not be implemented. At least this way the user knows he/she has to implement
> thier own. The way it stands the result is the programmers worst enemy, the
> silent error. However, by my reading of the spec, it is silent on the
> correct implementation of overlap for TIME data and therefore we should be
> free to do the right thing.

Hmm. We are discussing this so that all viewpoints and interpretations
are uncovered. But afaict the spec is very clear on this by the fact
that it does *not* call for exceptions or differences in the
implementation for the "datetime data types". And in the spec it does
not specify only TIMESTAMP variants for use in OVERLAPS. If the spec
calls for a particular behavior (which it seems to in this case) then
*someone* is going to be disappointed here; either you because it does
not do what you want or someone else who knows the spec and finds that
it does not do what they expect.

Extra pairs of eyes are helpful here; can anyone see that TIME is
excluded from the types defined for OVERLAPS (which would free us to Do
It Our Way) or if the spec calls for an implementation different from
the part of the spec I found (which might be The Right Way)?

If we end up agreeing as a group on what the spec calls for, and if it
turns out that it doesn't call for a wrapping behavior on time
boundaries, then you *could* fix this with your own function which
checks for wrapping behavior and acts accordingly.

We could also implement a separate function for time types which Does
The Right Thing.

- Thomas

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Clift 2002-02-16 03:16:40 Re: Ready to branch 7.2/7.3 ?
Previous Message Peter Eisentraut 2002-02-16 01:43:11 Re: Maintaining the list of release changes