Re: Removing SORTFUNC_LT/REVLT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Removing SORTFUNC_LT/REVLT
Date: 2005-12-29 15:49:23
Message-ID: 7077.1135871363@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> Hmm. By feature I assume you mean "ORDER BY ... USING" (which no-one
> could find an example of) and not "requiring the operator to be part of
> an opclass".

> In fact, I don't think we ever need to remove the syntax, just as long
> as the operator is part of an operator class, it'll be fine.

Well, no, that's not the problem: the problem is that you should be able
to specify ORDER BY any sort ordering that the system can deal with, and
the USING syntax is in fact too impoverished to do that. What if the
mentioned operator is in more than one operator class? I believe that
ATM the code makes a random choice of which opclass' sort function to
use, which pretty much sucks.

I haven't had time yet to digest the material you posted yesterday about
COLLATE. Maybe there's a solution in there, but I think it could only
happen if we assume that every potential sort operator appears in only
one opclass. Which seems like a pretty restrictive assumption, even
granted that COLLATE will start to carry some of the load of picking
different sorting options.

What I'd really like is to deprecate the "USING operator" syntax in
favor of a "USING operatorclassname" syntax. Actually, "USING opclass
[ASC/DESC]" would get the job done, since given an opclass you can
certainly run the sort function either normal or reverse.

We could keep the "USING operator" syntax but insist that it's only
allowed if there's exactly one possible opclass mapping.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-12-29 15:52:40 Re: localization problem (and solution)
Previous Message Simon Riggs 2005-12-29 15:10:40 Re: [Bizgres-general] WAL bypass for INSERT, UPDATE and