Re: Converting tab-complete.c's else-if chain to a switch

Thomas Munro <thomas.munro@gmail.com>

From: Thomas Munro <thomas.munro@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>, pgsql-hackers@lists.postgresql.org
Date: 2024-10-06T23:50:56Z
Lists: pgsql-hackers
On Mon, Oct 7, 2024 at 12:11 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Hmm, I should think that if you break anything in tab-complete.in.c,
> the breakage would propagate to tab-complete.c without difficulty.
> Do you have an example of something that the preprocessor would mask?

Fair point, and nope.  Thought withdrawn.



Commits

  1. Don't hard-code the input file name in gen_tabcomplete.pl's output.

  2. Avoid possible segfault in psql's tab completion.

  3. Convert tab-complete's long else-if chain to a switch statement.

  4. Prepare tab-complete.c for preprocessing.

  5. Invent "MatchAnyN" option for tab-complete.c's Matches/MatchesCS.