Re: row-wise comparison question/issue

From: Jeremy Drake <pgsql(at)jdrake(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: row-wise comparison question/issue
Date: 2006-10-20 22:36:29
Message-ID: Pine.BSO.4.64.0610201528380.9810@resin.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 20 Oct 2006, Tom Lane wrote:

> Jeremy Drake <pgsql(at)jdrake(dot)com> writes:
> > select rowval from myrowtypetable ORDER BY ROW((rowval).*) USING <;
> > ERROR: operator does not exist: record < record
>
> This isn't required by the spec, and it's not implemented. I don't
> see that it'd give any new functionality anyway, since you can always
> do ORDER BY rowval.f1, rowval.f2, ...
>
> The cases that are implemented are comparisons of explicit row
> constructors, eg "(a,b,c) < (d,e,f)" --- which I think is all
> you'll find support for in the spec.

I just think it is quite unexpected that the operator < is defined in some
places and not in others. And the way I wrote the order by, it should
have been comparing explicit row constructors (compare the explicitly
constructed row for each rowval in order to sort). I don't understand how
the operator < in a where clause would be different than the operator <
used by the order by. If I were to make a custom type in C, and write
these same operators for it, they would work in both places, right? Why
then would this be any different?

--
If someone had told me I would be Pope one day, I would have studied
harder.
-- Pope John Paul I

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-10-20 22:50:55 Re: Beta, RC Time?
Previous Message Bruce Momjian 2006-10-20 22:26:49 Re: Beta, RC Time?