Re: Create an index with a sort condition

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jim Nasby <jnasby(at)pervasive(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, sylsau <sylsau14(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Create an index with a sort condition
Date: 2006-04-04 05:55:15
Message-ID: 20060404055515.GD32226@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Apr 04, 2006 at 01:40:52AM -0400, Tom Lane wrote:
> Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> > [ Q about reverse-sort opclasses ]
>
> > Well, if COLLATE support ever gets done, it'll fix this too and be SQL
> > compliant to boot.
>
> I keep having a nagging feeling that COLLATE is a completely
> inappropriate way to deal with reverse-sort semantics for non-textual
> datatypes. Still waiting to see this patch ...

How so? All it does it invert the result of the comparison. If we do it
for textual types it'll work automatically for all other types too.

All the details of how it would work were described back here:
http://archives.postgresql.org/pgsql-hackers/2005-12/msg01121.php

The last patch unfortunatly no longer applies cleanly so you can't
really test it. If someone really wants this feature, now's the time to
pipe up.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Leon Pu 2006-04-04 05:59:47 Re: Database restoration performance issue on PostgreSQL 7.4.7
Previous Message Tom Lane 2006-04-04 05:53:39 Re: CREATE TABLE (with INHERITS) and ACCESS EXCLUSIVE locks