[PATCH] Improve tab completion after CREATE INDEX key list

From: Koshino Taiki <koshino(at)sraoss(dot)co(dot)jp>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: [PATCH] Improve tab completion after CREATE INDEX key list
Date: 2026-11-26 22:08:34
Message-ID: TY7P286MB974944DB10FB53DF9D4F936CED94422@TY7P286MB974944.JPNP286.PROD.OUTLOOK.COM
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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/

Attachment Content-Type Size
v1-0001-Improve-tab-completion-after-CREATE-INDEX-key-lis.patch application/octet-stream 4.5 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Koshino Taiki 2026-11-26 22:09:45 [PATCH] Improve tab completion for CREATE DOMAIN without AS
Previous Message Tom Lane 2026-11-26 21:43:44 Re: [PATCH] btree_gist: overflow in gbt_numeric_penalty (sibling of 15b3dc140d9)