BUG #5848: Between operator issue

Поиск
Список
Период
Сортировка
Искать

BUG #5848: Between operator issue

От:
"" <curt@net2business.com>
Дата:
The following bug has been logged online:

Bug reference:      5848
Logged by:          
Email address:      curt@net2business.com
PostgreSQL version: 8.1.22
Operating system:   Centos 5.5
Description:        Between operator issue
Details: 

Statement 'A between B and C' always false if B is greater than C, even if A
falls between them.

Re: BUG #5848: Between operator issue

От:
Bruce Momjian <bruce@momjian.us>
Дата:
curt@net2business.com wrote:
> 
> The following bug has been logged online:
> 
> Bug reference:      5848
> Logged by:          
> Email address:      curt@net2business.com
> PostgreSQL version: 8.1.22
> Operating system:   Centos 5.5
> Description:        Between operator issue
> Details: 
> 
> Statement 'A between B and C' always false if B is greater than C, even if A
> falls between them.

I think you want BETWEEN SYMMETRIC:

    BETWEEN SYMMETRIC</> is the same as BETWEEN</>
    except there is no requirement that the argument to the left of
    AND</> be less than or equal to the argument on the right.
    If it is not, those two arguments are automatically swapped, so that
    a nonempty range is always implied.

-- 
  Bruce Momjian          http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +

Re: BUG #5848: Between operator issue

От:
"Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Дата:
""  wrote:
 
> Statement 'A between B and C' always false if B is greater than C,
> even if A falls between them.
 
I'm pretty sure that's required by the standard, and doing otherwise
could break code which counts on standard semantics.
 
-Kevin
FAQ