Hi Álvaro, Solai
Thank you for working on the v2 patch.
I have a few comments:
1. SET LOCAL/SESSION for both we can also add TRANSACTION too in the tab
completion as both SET LOCAL TRANSACTION ISOLATION LEVEL READ
COMMITTED;, SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; are
valid.
2. SET SESSION list has both AUTHORIZATION and SESSION AUTHORIZATION. we
can remove the SESSION AUTHORIZATION and only keep AUTHORIZATION
3. Once LOCAL/SESSION is typed, the next tab stops working, this looks like
an existing gap but the v2 patch made it more visible.
SET LOCAL <var> <TAB>' should suggest TO, but doesn't.
SET LOCAL <var> TO <TAB>' should suggest GUC values
Same applies for SET SESSION too. The fix can be extended to something like
SET SESSION <var>. Fix is to teach both rules to accept an optional
LOCAL|SESSION slot, e.g.:
else if (Matches("SET", "LOCAL|SESSION", MatchAny) ||
Matches("SET", MatchAny))
COMPLETE_WITH("TO");
else if ((TailMatches("SET", MatchAny, "TO|=") ||
TailMatches("SET", "LOCAL|SESSION", MatchAny, "TO|=")) &&
!TailMatches("UPDATE", MatchAny, "SET", MatchAny, "TO|="))
{ ... }
or we can keep this for a follow-up patch.
Regards,
Surya Poondla