Re: [NOVICE] Boolean column in multicolumn index

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: [NOVICE] Boolean column in multicolumn index
Дата
Msg-id o2k3cj$grj$1@blaine.gmane.org
обсуждение исходный текст
Ответ на Re: [NOVICE] Boolean column in multicolumn index  (Gerald Cheves <gcheves@verizon.net>)
Список pgsql-novice
Gerald Cheves schrieb am 11.12.2016 um 16:20:
>>> CREATE INDEX "right" ON public.t USING btree (ci, cb, co);
>>> CREATE INDEX wrong ON public.t USING btree (ci, co);
>>> CREATE INDEX right_hack ON public.t USING btree (ci, (cb::integer), co);
>>> The problem is that I can't force PostgreSQL to use the "right" index.
>
> I meant why isright in quotes but the other indices are not in quotes?

Because "right" is a reserved keyword and can only be used as an identifier if you quote it:

https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS




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

Предыдущее
От: Gerald Cheves
Дата:
Сообщение: Re: [NOVICE] Boolean column in multicolumn index
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [NOVICE] Boolean column in multicolumn index