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