diff options
| author | Heikki Linnakangas | 2025-11-11 17:00:41 +0000 |
|---|---|---|
| committer | Heikki Linnakangas | 2025-11-11 17:00:41 +0000 |
| commit | 6956bca515e2a07a16c6d68b208766e97b275ddc (patch) | |
| tree | 63c14e2d258c56e9a861cfe35d315bf95e174dd5 /src/backend/tcop/utility.c | |
| parent | 676cd9ac07430282df71532b8d0a4f3c09831f76 (diff) | |
If you run pg_controldata on a cluster that has been initialized with
different PG_CONTROL_VERSION than what the pg_controldata program has
been compiled with, pg_controldata will still try to interpret the
control file, but the result is likely to be somewhat nonsensical. How
nonsensical it is depends on the differences between the versions. If
sizeof(ControlFileData) differs between the versions, the CRC will not
match and you get a warning of that, but otherwise you get no
warning.
Looking back at recent PG_CONTROL_VERSION updates, all changes that
would mess up the printed values have also changed
sizeof(ControlFileData), but there's no guarantee of that in future
versions.
Add an explicit check and warning for version number mismatch before
the CRC check. That way, you get a more clear warning if you use the
pg_controldata binary from wrong version, and if we change the control
file in the future in a way that doesn't change
sizeof(ControlFileData), this ensures that you get a warning in that
case too.
Discussion: https://www.postgresql.org/message-id/[email protected]
Diffstat (limited to 'src/backend/tcop/utility.c')
0 files changed, 0 insertions, 0 deletions
