Tom Lane wrote:
> Christopher Kings-Lynne <[EMAIL PROTECTED]> writes:
> > Can someone explain to me how:
> > (a, b) < (1, 2)
> > is different to
> > a < 1 and b < 2
> 
> Right at the moment our code interprets it that way, but this behavior
> is wrong per spec.  It should be an ordered column-by-column comparison,
> so that the equivalent simple expression is
> 
>       (a < 1) OR (a = 1 AND b < 2)

TODO updated:

        * %Make row-wise comparisons work per SQL spec
        
          Right now, '(a, b) < (1, 2)' is processed as 'a < 1 and b < 2', but
          the SQL standard requires it to be processed as a column-by-column
          comparison, so the proper comparison is '(a < 1) OR (a = 1 AND b < 2)'


-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

Reply via email to