Re: [PG-11] Potential bug related to INCLUDE clause of CREATE INDEX

From: Aditya Toshniwal <aditya(dot)toshniwal(at)enterprisedb(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PG-11] Potential bug related to INCLUDE clause of CREATE INDEX
Date: 2018-07-10 13:11:18
Message-ID: CAM9w-_=5aB8wBrw+06hX=XTPmGf5Vt5p3e0jLSto38LpTnZqBw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Team,

Please ignore the name after "Hi" in the previous mail. :/
The potential bug is a mentioned in the mail.

On Tue, Jul 10, 2018 at 6:37 PM, Aditya Toshniwal <
aditya(dot)toshniwal(at)enterprisedb(dot)com> wrote:

> Hi Dave,
>
> I am working on a feature to support INCLUDE clause of index in PG-11. As
> per the documentation https://www.postgresql.org/docs/11/static/sql-
> createindex.html, columns listed in INCLUDE clause cannot also be present
> as index key columns. But I find different behaviour for below queries
> which are logically identical.
>
> CREATE TABLE some_table
> (
> id serial primary key,
> first_name character varying(45),
> last_name character varying
> )
>
> CREATE INDEX ind1
> ON public.some_table USING btree
> (id)
> INCLUDE(id)
> TABLESPACE pg_default;
>
> This query fails with error
> ERROR: included columns must not intersect with key columns
>
> CREATE INDEX ind1
> ON public.some_table USING btree
> (id asc nulls last)
> INCLUDE(id)
> TABLESPACE pg_default;
>
> This query passes and index is created.
>
> Kindly let me know if I am missing anything.
>
> --
> Thanks and Regards,
> Aditya Toshniwal
> Software Engineer | EnterpriseDB Software Solutions | Pune
> "Don't Complain about Heat, Plant a tree"
>

--
Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB Software Solutions | Pune
"Don't Complain about Heat, Plant a tree"

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2018-07-10 13:17:41 Re: [PATCH] Add support for ON UPDATE/DELETE actions on ALTER CONSTRAINT
Previous Message Aditya Toshniwal 2018-07-10 13:07:54 [PG-11] Potential bug related to INCLUDE clause of CREATE INDEX