Re: [NOVICE] Boolean column in multicolumn index - Mailing list pgsql-novice

From Thomas Kellerer
Subject Re: [NOVICE] Boolean column in multicolumn index
Date
Msg-id o2k3cj$grj$1@blaine.gmane.org
Whole thread Raw
In response to Re: [NOVICE] Boolean column in multicolumn index  (Gerald Cheves <gcheves@verizon.net>)
List 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 by date:

Previous
From: Gerald Cheves
Date:
Subject: Re: [NOVICE] Boolean column in multicolumn index
Next
From: Tom Lane
Date:
Subject: Re: [NOVICE] Boolean column in multicolumn index