Re: Added missing tab completion for alter subscription set option

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Added missing tab completion for alter subscription set option
Date: 2021-05-20 16:04:47
Message-ID: CALDaNm1hYnwEynUb4RH0fzsPR60+8-XkpDT2-LQH9_-9V_XBzg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 18, 2021 at 9:20 PM Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
>
> On 2021-May-14, vignesh C wrote:
>
> > While I was reviewing one of the logical decoding features, I found
> > Streaming and binary options were missing in tab completion for the
> > alter subscription set option, the attached patch has the changes for
> > the same.
> > Thoughts?
>
> I wish we didn't have to keep knowledge in the psql source on which
> option names are to be used for each command. If we had some function
> SELECT pg_completion_options('alter subscription set');
> that returned the list of options usable for each command, we wouldn't
> have to ... psql would just retrieve the list of options for the current
> command.
>
> Maintaining such a list does not seem hard -- for example we could just
> have a function alongside parse_subscription_option() that returns the
> names that are recognized by that one. If we drive the implementation
> of both off a single struct, it would never be outdated.
>

On further analysis, I felt that as psql is a front end client, we
should not put any dependency on backend code. I felt that might be
the reason it has been coded to mention the options directly in
tab-complete instead of having any dependency on backend code. we
could have the common module to maintain the options and have both
frontend and backend access it or Should we retain the changes like
the earlier patch.
Thoughts?

Regards,
Vignesh

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-05-20 16:10:26 Re: Added missing tab completion for alter subscription set option
Previous Message Laurenz Albe 2021-05-20 15:53:40 Re: Clarify how triggers relate to transactions