row value constructor bug?

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

row value constructor bug?

От:
Tatsuo 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

Re: row value constructor bug?

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Tatsuo Ishii  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

Re: row value constructor bug?

От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:
> Tatsuo Ishii  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

FAQ