public inbox for [email protected]  
help / color / mirror / Atom feed
From: Masahiko Sawada <[email protected]>
To: Yamaguchi Atsuo <[email protected]>
Cc: [email protected]
Subject: Re: Add tab completion for SERVER and CONNECTION keywords in psql
Date: Mon, 23 Mar 2026 13:14:04 -0700
Message-ID: <CAD21AoB4-jPS4CfhMcX72+8L=qGV2Q_9354yqKGj-d6ZgfkE4Q@mail.gmail.com> (raw)
In-Reply-To: <CAKSyusJWdWcUKVd3qJXcEaQxJewGymQWV_r3-mc=Knrqo0AZ_g@mail.gmail.com>
References: <CAKSyusJWdWcUKVd3qJXcEaQxJewGymQWV_r3-mc=Knrqo0AZ_g@mail.gmail.com>

Hi,

On Sun, Mar 22, 2026 at 1:30 PM Yamaguchi Atsuo <[email protected]> wrote:
>
> Hi,
>
> This patch adds missing tab completion support in psql for:
>
> - SERVER keyword after ALTER/CREATE SUBSCRIPTION <name>
> - CONNECTION keyword after ALTER/CREATE FOREIGN DATA WRAPPER <name>
>
> Currently, typing "ALTER SUBSCRIPTION sub1 SERVER" and pressing Tab
> does not complete server names, even though the SERVER keyword itself
> is already suggested. Similarly, CONNECTION is not suggested as a
> completion candidate for FOREIGN DATA WRAPPER commands, despite being
> a valid option.
>
> The patch is generated against the current master branch.

It's a fix for an oversight of commit 8185bb5347 rather than proposing
a new tab-completion. Good catch. Regarding the patch, I have one
comment:

    /* ALTER FOREIGN DATA WRAPPER <name> */
    else if (Matches("ALTER", "FOREIGN", "DATA", "WRAPPER", MatchAny))
        COMPLETE_WITH("HANDLER", "VALIDATOR", "NO",
-                     "OPTIONS", "OWNER TO", "RENAME TO");
+                     "OPTIONS", "OWNER TO", "RENAME TO", "CONNECTION");

I think it's better to maintain the keywords in the list in alphabetical order.

Regards,

-- 
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com





view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Add tab completion for SERVER and CONNECTION keywords in psql
  In-Reply-To: <CAD21AoB4-jPS4CfhMcX72+8L=qGV2Q_9354yqKGj-d6ZgfkE4Q@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox