Re: [PATCH] psql: Add tab-complete for optional view parameters

Dean Rasheed <dean.a.rasheed@gmail.com>

From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: vignesh C <vignesh21@gmail.com>
Cc: Christoph Heiss <christoph@c8h4.io>, Melih Mutlu <m.melihmutlu@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2023-01-06T12:18:44Z
Lists: pgsql-hackers
On Fri, 6 Jan 2023 at 11:52, vignesh C <vignesh21@gmail.com> wrote:
>
> One suggestion:
> Tab completion for "alter view v1 set (check_option =" is handled to
> complete with CASCADED and LOCAL but the same is not handled for
> create view: "create view viewname with ( check_option ="
> +       else if (Matches("ALTER", "VIEW", MatchAny, "SET", "(",
> "check_option", "="))
> +               COMPLETE_WITH("local", "cascaded");
>
> I felt we should keep the handling consistent for both create view and
> alter view.
>

Hmm, I don't think we should be offering "check_option" as a tab
completion for CREATE VIEW at all, since that would encourage users to
use non-SQL-standard syntax, rather than CREATE VIEW ... WITH
[CASCADED|LOCAL] CHECK OPTION.

Regards,
Dean



Commits

  1. psql: Add tab completion for view options.

  2. Fix typos in code and comments