Fix off-by-one in XLogRecordMaxSize check.

Noah Misch <noah@leadboat.com>

Commit: 7823a298ba5c54a67f98c928f73500bc4089449f
Author: Noah Misch <noah@leadboat.com>
Date: 2023-08-12T21:37:11Z
Releases: 16.0
Fix off-by-one in XLogRecordMaxSize check.

pg_logical_emit_message(false, '_', repeat('x', 1069547465)) failed with
self-contradictory message "WAL record would be 1069547520 bytes (of
maximum 1069547520 bytes)".  There's no particular benefit from allowing
or denying one byte in either direction; XLogRecordMaxSize could rise a
few megabytes without trouble.  Hence, this is just for cleanliness.
Back-patch to v16, where this check first appeared.

Files

PathChange+/−
src/backend/access/transam/xloginsert.c modified +1 −1