Re: Request: set opclass for generated unique and primary key indexes - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: Request: set opclass for generated unique and primary key indexes
Date
Msg-id BAY20-F8AF4831EF3A6FC853FE4AF9FD0@phx.gbl
Whole thread Raw
In response to Re: Request: set opclass for generated unique and primary key indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Request: set opclass for generated unique and primary
List 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/



pgsql-hackers by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: Re: Pgfoundry and gborg: shut one down
Next
From: Stephan Szabo
Date:
Subject: Re: Request: set opclass for generated unique and primary