On 2024-07-08 14:18:03 -0400, Tom Lane wrote: > Andres Freund <andres@anarazel.de> writes: > > Compiling postgres on windows with tab-completion support fails either with > > "fatal error C1026: parser stack overflow, program too complex”. > > or (in recent versions) with > > "…/src/bin/psql/tab-complete.c(4023): fatal error C1001: Internal compiler error." > > > It's pretty easy to work around the error [2]. I wonder if we should just do > > that, then we don't have to insist on a very new msvc version being used and > > it'll work even if they just decide to fix the internal compiler error. > > I'm on board with doing something here, but wouldn't we want to > back-patch at least a minimal fix to all supported branches?
I think we'd need to backpatch more for older branches. At least
commit 3f28bd7337d Author: Thomas Munro <tmunro@postgresql.org> Date: 2022-12-22 17:14:23 +1300
Add work-around for VA_ARGS_NARGS() on MSVC.
Given that - afaict - tab completion never used to work with msvc, I think it'd be ok to just do it in 17 or 16+17 or such. Obviously nobody is currently building with readline support for windows - not sure if any packager is going to go back and add support for it in older branches.
Packagers aren't likely to be using readline, as it's GPL and it would have to be shipped with packages on Windows. They are more likely to be using libedit if anything. Not sure if that has any bearing on the compilation failure.