In my understanding below row value constructors(I hope this term is
correct) exaples should return true, but PostgreSQL does not.

test=# select (1,0) > (0,0);
 ?column? 
----------
 f
(1 row)

test=# select (0,1) > (0,0);
 ?column? 
----------
 f
(1 row)

In my understanding, (a,b) > (c,d) is equal to:

　a > c or (a = c and b > d)
--
Tatsuo Ishii

Wed, 10 Oct 2001 10:18:42 +0900
Tatsuo Ishii <t-ishii@sra.co.jp>
row value constructor bug?
Tatsuo Ishii <t-ishii@sra.co.jp> writes:
> In my understanding below row value constructors(I hope this term is
> correct) exaples should return true, but PostgreSQL does not.

By my reading, a "row value constructor" is one of the things in
parentheses, while the whole clause is a "comparison predicate"
(per section 8.2 of SQL92).  But I agree that we don't seem to
have implemented the semantics correctly.  The code currently
responsible for this is makeRowExpr() in gram.y ... I tend to
agree with the comment on it that says that the functionality
should be pushed deeper ...

			regards, tom lane

Thu, 11 Oct 2001 01:37:49 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: row value constructor bug? 
> Tatsuo Ishii <t-ishii@sra.co.jp> writes:
> > In my understanding below row value constructors(I hope this term is
> > correct) exaples should return true, but PostgreSQL does not.
> 
> By my reading, a "row value constructor" is one of the things in
> parentheses, while the whole clause is a "comparison predicate"
> (per section 8.2 of SQL92).  But I agree that we don't seem to
> have implemented the semantics correctly.  The code currently
> responsible for this is makeRowExpr() in gram.y ... I tend to
> agree with the comment on it that says that the functionality
> should be pushed deeper ...

TODO item here?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Fri, 12 Oct 2001 23:56:18 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: row value constructor bug?