row value constructor bug?

Started by Tatsuo Ishiiover 24 years ago3 messages
#1Tatsuo Ishii
t-ishii@sra.co.jp

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tatsuo Ishii (#1)
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 ...

regards, tom lane

#3Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Tom Lane (#2)
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