Re: Boolean column in multicolumn index

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Boolean column in multicolumn index
Date: 2016-12-11 17:45:59
Message-ID: o2k3cj$grj$1@blaine.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2016-12-13 05:21:44 Re: Boolean column in multicolumn index
Previous Message Gerald Cheves 2016-12-11 15:20:04 Re: Boolean column in multicolumn index