Re: [PATCH] psql: Add tab-complete for optional view parameters - Mailing list pgsql-hackers

From Melih Mutlu
Subject Re: [PATCH] psql: Add tab-complete for optional view parameters
Date
Msg-id CAGPVpCQL-oUu-f0F+y-apNMVm0aY1Y_irqU3JB6Rn8vLGRTHYA@mail.gmail.com
Whole thread Raw
In response to [PATCH] psql: Add tab-complete for optional view parameters  (Christoph Heiss <christoph@c8h4.io>)
Responses Re: [PATCH] psql: Add tab-complete for optional view parameters  (Christoph Heiss <christoph@c8h4.io>)
List 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

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Non-decimal integer literals
Next
From: Sergey Shinderuk
Date:
Subject: Add PL/pgSQL extra check no_data_found