Make error messages about WAL segment size more consistent
authorPeter Eisentraut <peter@eisentraut.org>
Mon, 28 Aug 2023 13:15:20 +0000 (15:15 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Mon, 28 Aug 2023 13:17:04 +0000 (15:17 +0200)
commit36e4419d1f1ef06bba58a28a870aaaa8de73bb46
tree9884e1cad81ae0aab5e7aba9f6d9bf676b8a7a3f
parentbb9002257b2211c213ad5989446d83a61c6446d3
Make error messages about WAL segment size more consistent

Make the primary messages more compact and make the detail messages
uniform.  In initdb.c and pg_resetwal.c, use the newish
option_parse_int() to simplify some of the option parsing.  For the
backend GUC wal_segment_size, add a GUC check hook to do the
verification instead of coding it in bootstrap.c.  This might be
overkill, but that way the check is in the right place and it becomes
more self-documenting.

In passing, make pg_controldata use the logging API for warning
messages.

Reviewed-by: Aleksander Alekseev <aleksander@timescale.com>
Discussion: https://www.postgresql.org/message-id/flat/9939aa8a-d7be-da2c-7715-0a0b5535a1f7@eisentraut.org
12 files changed:
src/backend/access/transam/xlog.c
src/backend/bootstrap/bootstrap.c
src/backend/utils/misc/guc_tables.c
src/bin/initdb/initdb.c
src/bin/pg_basebackup/streamutil.c
src/bin/pg_controldata/pg_controldata.c
src/bin/pg_controldata/t/001_pg_controldata.pl
src/bin/pg_resetwal/Makefile
src/bin/pg_resetwal/pg_resetwal.c
src/bin/pg_rewind/pg_rewind.c
src/bin/pg_waldump/pg_waldump.c
src/include/utils/guc_hooks.h