Re: [PROPOSAL] Covering + unique indexes.

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: [PROPOSAL] Covering + unique indexes.
Дата
Msg-id 55F6F7AD.4080307@BlueTreble.com
обсуждение исходный текст
Ответ на [PROPOSAL] Covering + unique indexes.  (Anastasia Lubennikova <a.lubennikova@postgrespro.ru>)
Ответы Re: [PROPOSAL] Covering + unique indexes.  (Teodor Sigaev <teodor@sigaev.ru>)
Список pgsql-hackers
On 9/11/15 7:45 AM, Anastasia Lubennikova wrote:
> This idea has obvious restriction. We can set unique only for first
> index columns.
> There is no clear way to maintain following index.
> CREATE INDEX index ON table (c1, c2, c3) UNIQUE ON (c1, c3);
>
> So I suggest following syntax:
> CREATE [UNIQUE {ON FIRST {COLUMN | n_unique_column COLUMNS}} INDEX ON
> table_name (column_name1, column_name2 ...);

I would use the first (simple) syntax and just throw an error if the 
user tries to skip a column on the UNIQUE clause.

Have you by chance looked to see what other databases have done for 
syntax? I'm guessing this isn't covered by ANSI but maybe there's 
already an industry consensus.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com



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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: RLS open items are vague and unactionable
Следующее
От: Egon Kocjan
Дата:
Сообщение: [PATCH] add --log-output to pg_ctl on Windows