Re: Best way to use indexes for partial match at

From: "Andrus" <eetasoft(at)online(dot)ee>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Best way to use indexes for partial match at
Date: 2005-11-11 09:31:37
Message-ID: dl1oe2$1578$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> Ya know, this brings up an interesting question, would it be feasible to
> allow for a function of somekind to be applied as an argument to a
> primary key declaration? It would certainly be useful for character
> type pks in non-C locales.

Using this would require making non-standard changes to ddl statements and
thus is not good.

Best solution is as follows:

Planner must use index

CREATE TABLE foo ( bar CHAR(10) PRIMARY KEY );

for queries like

SELECT * FROM foo WHERE bar::CHAR(3)='ABC';

Can you make this patch or add this to todo list ?

Andrus.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Guido Neitzer 2005-11-11 09:43:42 Re: Ordering and unicode
Previous Message Richard Huxton 2005-11-11 09:05:37 Re: Two slightly different queries produce same results,