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

Поиск
Список
Период
Сортировка
От Andrus
Тема Re: Best way to use indexes for partial match at beginning
Дата
Msg-id dktrp5$b1g$2@news.hub.org
обсуждение исходный текст
Ответ на Best way to use indexes for partial match at beginning  ("Andrus Moor" <eetasoft@online.ee>)
Ответы Re: Best way to use indexes for partial match at beginning  (Jaime Casanova <systemguards@gmail.com>)
Список pgsql-general
>> CREATE TABLE foo ( bar CHAR(10)  PRIMARY KEY);
>>
>> Cluster locale is non-C. Database encoding is UTF-8. Postgres vers is 8.1

>Do this instead:

>CREATE TABLE foo ( bar CHAR(10) NOT NULL );
>CREATE UNIQUE INDEX foo_bar ON foo(bar char_pattern_ops);

Martijn,

Thank you. I have CHAR columns and need a primary key also. So I tried the
code

CREATE TABLE foo ( bar CHAR(10) NOT NULL );
CREATE UNIQUE INDEX foo_bar ON foo(bar bpchar_pattern_ops);
ALTER TABLE foo ADD PRIMARY KEY (bar);

I found that adding primary key creates another index.

How to create primary key without duplicate index on bar column ?

Andrus.



В списке pgsql-general по дате отправления:

Предыдущее
От: "Andrus"
Дата:
Сообщение: Re: Best way to use indexes for partial match at
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Best way to use indexes for partial match at