pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #5848: Between operator issue
3+ messages / 3 participants
[nested] [flat]

* BUG #5848: Between operator issue
@ 2011-01-25 20:47  curt@net2business.com
  0 siblings, 2 replies; 3+ messages in thread

From: curt@net2business.com @ 2011-01-25 20:47 UTC (permalink / raw)
  To: pgsql-bugs


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.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #5848: Between operator issue
@ 2011-01-25 21:26  Bruce Momjian <bruce@momjian.us>
  parent: curt@net2business.com
  1 sibling, 0 replies; 3+ messages in thread

From: Bruce Momjian @ 2011-01-25 21:26 UTC (permalink / raw)
  To: curt@net2business.com; +Cc: pgsql-bugs

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:

    <literal>BETWEEN SYMMETRIC</> is the same as <literal>BETWEEN</>
    except there is no requirement that the argument to the left of
    <literal>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  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #5848: Between operator issue
@ 2011-01-25 21:27  Kevin Grittner <Kevin.Grittner@wicourts.gov>
  parent: curt@net2business.com
  1 sibling, 0 replies; 3+ messages in thread

From: Kevin Grittner @ 2011-01-25 21:27 UTC (permalink / raw)
  To: curt@net2business.com; pgsql-bugs

"" <curt@net2business.com> 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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2011-01-25 21:27 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-01-25 20:47 BUG #5848: Between operator issue curt@net2business.com
2011-01-25 21:26 ` Bruce Momjian <bruce@momjian.us>
2011-01-25 21:27 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox