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-30 15:18:48
Message-ID: 12067.1135955928@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:
> On Thu, Dec 29, 2005 at 10:49:23AM -0500, Tom Lane wrote:
>> 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.

> Thought of something this morning: this seems OK at first glance but I
> don't think it's workable. The example being locale dependant sorting.
> I really don't think we want to create a new operator class for each
> possible way you can sort strings.

Well, you would need to add a COLLATE layer on top of this in just the
same way as you'd need a COLLATE layer now if you want locale-dependent
sorting. I didn't claim it handled that; just pointing out that COLLATE
doesn't handle this, either.

> Collations (currently anyway) are really just an operator class +
> [ASC/DESC] + optional locale rolled into a single identifier.

I really need to study your mail from the other day, but unfortunately
other pressures will probably keep me from getting to it today :-(.
One comment though --- it's not really sane to include ASC/DESC in there
is it? I thought the spec wanted ORDER BY foo COLLATE bar [ASC/DESC]
... or if not, users certainly will. If every single collation has to
be created in a matched ASC/DESC pair, you've done it wrong.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-12-30 16:49:59 Re: [Bizgres-general] WAL bypass for INSERT, UPDATE and
Previous Message Martijn van Oosterhout 2005-12-30 15:07:25 Re: Removing SORTFUNC_LT/REVLT