Re: [PATCH] Improve tab completion after CREATE INDEX key list

From: Sho Ito <i(dot)sho(dot)0628(at)gmail(dot)com>
To: Koshino Taiki <koshino(at)sraoss(dot)co(dot)jp>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Improve tab completion after CREATE INDEX key list
Date: 2026-11-29 00:38:31
Message-ID: CAG7L5+5bct7GiZJdsscFpKY+HS9UJwDZBSZ2oprBJMX8wL4Yqg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Taiki,

I reviewed v1 on master with assertions enabled. All four psql TAP suites
pass, as do additional checks covering the supported forms, quoted index
names, expressions, and `CREATE SCHEMA` embedding. It looks good to me.

Regarding the tests, I'm not sure if we need a separate test for each
supported
form, given the discussion in [1].

[1]
https://www.postgresql.org/message-id/flat/CAHza6qdYj10_sj7L1BsVubw7VkH-YepFXxfNM4jA1cupgDd-Qg%40mail.gmail.com#0096ee8864c79c11524dbb14ffc01649

Thanks,
Sho

On Thu, Nov 26, 2026 at 5:08 PM Koshino Taiki <koshino(at)sraoss(dot)co(dot)jp> wrote:

> Hi,
>
> psql currently offers no completion after a CREATE INDEX key list:
>
> postgres=# CREATE INDEX idx ON tab1 (c1) <Tab>
>
> The attached patch offers the clauses valid at this position:
>
> INCLUDE ( NULLS DISTINCT NULLS NOT DISTINCT WITH ( TABLESPACE WHERE
>
> It also completes the remainder of NULLS:
>
> postgres=# CREATE UNIQUE INDEX idx ON tab1 (c1) NULLS <Tab>
> DISTINCT NOT DISTINCT
>
> The change covers named and unnamed indexes, with CONCURRENTLY and
> USING where applicable. It is limited to forms already recognized by
> the existing completion rules; IF NOT EXISTS and ONLY would require
> changes to earlier completion stages.
>
> Tests for the supported forms are included.
>
> Regards,
> Taiki Koshino
>
> Taiki Koshino<koshino(at)sraoss(dot)co(dot)jp>
> SRA OSS K.K.
> TEL: 03-5979-2701 FAX: 03-5979-2702
> URL: https://www.sraoss.co.jp/
>
>

--
=======================================
*Sho Ito (Sean)*

E-mail: i(dot)sho(dot)0628(at)gmail(dot)com
LinkedIn: *https://www.linkedin.com/in/sho-ito-0628/
<https://www.linkedin.com/in/sho-ito-0628/>*
GitHub: https://github.com/sean0628/
=======================================

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2026-11-29 01:10:47 Re: Proposal: Include CHECK constraint expression in violation error DETAIL
Previous Message Robert Haas 2026-11-28 23:48:17 Re: Add read-only disconnect_requested GUC for graceful client disconnect