Re: Request: set opclass for generated unique and primary

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)hotmail(dot)com>
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, pvasickova(at)hotmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Request: set opclass for generated unique and primary
Date: 2006-02-22 22:56:42
Message-ID: 20060222145513.D79453@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Wed, 22 Feb 2006, Pavel Stehule wrote:

> > > >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.
> >
> >Why do you need both the unique index with varchar_pattern_ops and one
> >with the default ops?
>
> Because LIKE op don't use index on default ops with non C locale. I found it
> on tables of czech communities. Primary key is NUTS - 4..6 numbers. I have
> to search values with some prefix -> op Like and on primary key can't to use
> std. index.

Right, but does the pattern_ops one have to be unique?
And if it does, do you need the normal unique constraint as well?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John 2006-02-22 23:53:08 Which func tells the tuple size of a given relation?
Previous Message Pavel Stehule 2006-02-22 22:53:54 Re: Request: set opclass for generated unique and primary key indexes