Re: Request: set opclass for generated unique and primary key indexes

From: "Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us, pvasickova(at)hotmail(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Request: set opclass for generated unique and primary key indexes
Date: 2006-02-22 21:50:49
Message-ID: BAY20-F8AF4831EF3A6FC853FE4AF9FD0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>Why would you need it?
I can't to use unique index for like_op without setting opclass, because I
have to use czech locale. I can create second index, but then I have two
equal indexes. Example:

number | description
000102 blabla bla
000103 bbbb fooo

number: varchar primary key.

Sometimes I need search all values with one prefix ~ like '0001%'. That's
all.

>
> > USING INDEX [TABLESPACE ..] [OPCLASS ..]
>
>This is unworkable --- consider a table with more than one unique
>constraint and/or multiple-column constraints.
>
I forgot (full syntax is):
CREATE TABLE ....
number varchar PRIMARY KEY USING OPCLAS varchar_pattern_ops,
...
>I seem to recall someone proposing extending the syntax of the UNIQUE
>constraints themselves, but there really isn't enough use-case to
>justify it AFAICS. Especially not when you can always use CREATE UNIQUE
>INDEX.

I can always use second unique index. But it's redundant. This problem is
related to using nonC locale.

Regards
Pavel Stehule

_________________________________________________________________
Najdete si svou lasku a nove pratele na Match.com. http://www.msn.cz/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Shaun Thomas 2006-02-22 22:02:31 Attempting upgrade path; is this possible?
Previous Message Marc G. Fournier 2006-02-22 20:26:27 Re: Pgfoundry and gborg: shut one down