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<[email protected]>
SRA OSS K.K.
TEL: 03-5979-2701 FAX: 03-5979-2702
URL: https://www.sraoss.co.jp/

Attachment: v1-0001-Improve-tab-completion-after-CREATE-INDEX-key-lis.patch
Description: v1-0001-Improve-tab-completion-after-CREATE-INDEX-key-lis.patch

Reply via email to