Re: [PATCH] Tab completion for ALTER TABLE … ADD …

From: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Tab completion for ALTER TABLE … ADD …
Date: 2021-08-30 13:38:19
Message-ID: 87h7f7uk6s.fsf@wibble.ilmari.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Paquier <michael(at)paquier(dot)xyz> writes:

> On Fri, Aug 27, 2021 at 11:52:33AM +0100, Dagfinn Ilmari Mannsåker wrote:
>> That was easy enough to add (just a bit of extra fiddling to handle
>> COLUMN being optional), done in the attached v2 patch.
>
> This part was a bit misleading, as it would recommend a list of types
> when specifying just ADD CONSTRAINT for example, so I have removed
> it.

That was because I forgot to exclude all the other object types that can
come after ADD. Attached is a patch that does that. I also moved it
right next to the ALTER TABLE … ADD completion, and added a comment to
keep the two lists in sync.

> An extra thing that felt a bit overdoing is the addition of KEY after
> PRIMARY/FOREIGN.

Yeah, I guess people are unlikely to write out the whole PRIMARY or FOREIGN
and only then hit tab to complete the rest.

>> Doing a list of arbitrarily many comma-separated names is more
>> complicated, so that can be the subject for another patch.
>
> No objections to that. I have applied what we have now, as that's
> already an improvement.

Thanks!

- ilmari

Attachment Content-Type Size
0001-Complete-type-names-after-ALTER-TABLE-ADD-COLUMN.patch text/x-diff 1.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2021-08-30 14:03:39 Re: pgsql: Avoid using ambiguous word "positive" in error message.
Previous Message Ajin Cherian 2021-08-30 12:18:06 Re: Failure of subscription tests with topminnow