Re: Best way to use indexes for partial match at beginning

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 beginning
Date: 2005-11-09 22:16:07
Message-ID: dktsfh$ech$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> SELECT * FROM foo WHERE bar::CHAR(1) = 'A';
> SELECT * FROM foo WHERE bar::CHAR(1) = 'B';
> SELECT * FROM foo WHERE bar::CHAR(2) = 'BC';
> SELECT * FROM foo WHERE bar::CHAR(3) = 'ABC';

Dean,

thank you. That would be EXCELLENT solution!

Can you confirm that in this case Postgres 8.1 can use index created by

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

even on non-C locale ?

Andrus.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-11-09 22:20:35 Re: set-valued function difference in 8.1.0 vs 8.0.2
Previous Message Scott Marlowe 2005-11-09 22:14:59 Re: Best way to use indexes for partial match at