Re: pg_dump versus ancient server versions

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Andres Freund <andres@anarazel.de>, Andrew Dunstan <andrew@dunslane.net>, Bruce Momjian <bruce@momjian.us>, Robert Haas <robertmhaas@gmail.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-12-03T17:10:07Z
Lists: pgsql-hackers
Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:
> [ policy requiring that 9.2 and up be kept buildable, as of today ]

I experimented to see what this would entail exactly.  Using
current macOS (Apple clang version 13.0.0) on M1 hardware,
I built with minimal configure options (--enable-debug --enable-cassert)
and ran the core regression tests.  I found that commit
1c0cf52b3 (Use return instead of exit() in configure) is needed
in 9.4 and before, else we don't get through configure.
That's the only fix needed to get a clean build in 9.4 and 9.3.
9.2 shows several compiler warnings, the scarier ones of which could
be cleaned up by back-patching c74d586d2 (Fix function return type
confusion).  The remainder are variable-may-be-used-uninitialized
warnings, which I think people are accustomed to ignoring in
dubious cases.  In any case, I failed to get rid of them without
back-patching 71450d7fd (Teach compiler that ereport(>=ERROR) does
not return), which seems like a bridge too far.

I also tried 9.1, but it has multiple compile-time problems:
* fails to select a spinlock implementation
* "conflicting types for 'base_yylex'"
* strange type-conflict warnings in zlib calls

So at least on this platform, there are solid technical reasons
to select 9.2 not 9.1 as the cutoff.

Obviously, we might find some other things to fix if we checked
with other compilers, or tested more than the core tests.
But this much seems quite doable, and it's probably prerequisite
for any further testing.

			regards, tom lane



Commits

  1. Remove psql support for server versions preceding 9.2.

  2. Clean up some more freshly-dead code in pg_dump and pg_upgrade.

  3. Remove pg_dump's --no-synchronized-snapshots switch.

  4. Remove pg_upgrade support for upgrading from pre-9.2 servers.

  5. Remove pg_dump/pg_dumpall support for dumping from pre-9.2 servers.

  6. Suppress -Warray-bounds warning in 9.2's xlog.c.

  7. Suppress -Wformat-overflow warnings in 9.2's xml.c.

  8. Disable -Wsometimes-uninitialized warnings in the 9.2 branch.

  9. Fix function return type confusion

  10. Fix compiler warning

  11. Silence another gcc 11 warning.

  12. Suppress uninitialized-variable warning in guc.c.

  13. Suppress -Warray-parameter warnings in pgcrypto/sha2.c.

  14. Reformat imath.c macro to remove -Wmisleading-indentation warnings.

  15. Clean up compilation warnings coming from PL/Perl with clang-12~

  16. Make ecpg's rjulmdy() and rmdyjul() agree with their declarations.

  17. Use -Wno-format-truncation and -Wno-stringop-truncation, if available.

  18. Make pg_upgrade's test.sh less chatty.

  19. Add checks for valid multibyte character length in UtfToLocal, LocalToUtf.

  20. Use return instead of exit() in configure

  21. Add support for Visual Studio 2019 in build scripts