Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group