Thread

Commits

  1. psql: Fix tab completion for FOREIGN DATA WRAPPER and SUBSCRIPTION.

  2. CREATE SUBSCRIPTION ... SERVER.

  1. Add tab completion for SERVER and CONNECTION keywords in psql

    Yamaguchi Atsuo <acrobatcoder@gmail.com> — 2026-03-22T20:30:30Z

    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.
    
    Regards,
    Atsuo Yamaguchi
    
  2. Re: Add tab completion for SERVER and CONNECTION keywords in psql

    Masahiko Sawada <sawada.mshk@gmail.com> — 2026-03-23T20:14:04Z

    Hi,
    
    On Sun, Mar 22, 2026 at 1:30 PM Yamaguchi Atsuo <acrobatcoder@gmail.com> 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
    
    
    
    
  3. Re: Add tab completion for SERVER and CONNECTION keywords in psql

    Yamaguchi Atsuo <acrobatcoder@gmail.com> — 2026-03-25T15:43:58Z

    Hi,
    
    On Mon, Mar 23, 2026 at 1:14 PM Masahiko Sawada <sawada.mshk@gmail.com>
    wrote:
    
    > Hi,
    >
    > On Sun, Mar 22, 2026 at 1:30 PM Yamaguchi Atsuo <acrobatcoder@gmail.com>
    > 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
    
    
     Thank you for the review. I have updated the code to maintain the keywords
    in alphabetical order.
    
    Regards,
    Atsuo Yamaguchi
    
  4. Re: Add tab completion for SERVER and CONNECTION keywords in psql

    Masahiko Sawada <sawada.mshk@gmail.com> — 2026-03-25T16:33:03Z

    On Wed, Mar 25, 2026 at 8:44 AM Yamaguchi Atsuo <acrobatcoder@gmail.com> wrote:
    >
    > Hi,
    >
    > On Mon, Mar 23, 2026 at 1:14 PM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
    >>
    >> Hi,
    >>
    >> On Sun, Mar 22, 2026 at 1:30 PM Yamaguchi Atsuo <acrobatcoder@gmail.com> 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
    >
    >
    >  Thank you for the review. I have updated the code to maintain the keywords in alphabetical order.
    
    Thank you for updating the patch! Pushed.
    
    Regards,
    
    -- 
    Masahiko Sawada
    Amazon Web Services: https://aws.amazon.com