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

From: Melih Mutlu <m(dot)melihmutlu(at)gmail(dot)com>
To: Christoph Heiss <christoph(at)c8h4(dot)io>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] psql: Add tab-complete for optional view parameters
Date: 2022-12-08 11:19:25
Message-ID: CAGPVpCQL-oUu-f0F+y-apNMVm0aY1Y_irqU3JB6Rn8vLGRTHYA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Christoph,

I just took a quick look at your patch.
Some suggestions:

+ else if (Matches("ALTER", "VIEW", MatchAny, "SET", "("))
> + COMPLETE_WITH_LIST(view_optional_parameters);
> + /* ALTER VIEW xxx RESET ( yyy , ... ) */
> + else if (Matches("ALTER", "VIEW", MatchAny, "RESET", "("))
> + COMPLETE_WITH_LIST(view_optional_parameters);

What about combining these two cases into one like Matches("ALTER", "VIEW",
MatchAny, "SET|RESET", "(") ?

/* ALTER VIEW <name> */
> else if (Matches("ALTER", "VIEW", MatchAny))
> COMPLETE_WITH("ALTER COLUMN", "OWNER TO", "RENAME",
> "SET SCHEMA");

Also seems like SET and RESET don't get auto-completed for "ALTER VIEW
<name>".
I think it would be nice to include those missing words.

Thanks,
--
Melih Mutlu
Microsoft

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergey Shinderuk 2022-12-08 11:29:20 Add PL/pgSQL extra check no_data_found
Previous Message Peter Eisentraut 2022-12-08 11:16:29 Re: Non-decimal integer literals