pgsql: Accept "B" in all memory-unit GUCs, and improve error messages.

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Accept "B" in all memory-unit GUCs, and improve error messages.
Дата
Msg-id E1fLO8O-0002ZH-Ux@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Accept "B" in all memory-unit GUCs, and improve error messages.

Commit 6e7baa3227 added support for "B" unit, for specifying config options
in bytes. However, it was only accepted in GUC_UNIT_BYTE settings,
wal_segment_size and track_activity_query_size, and not e.g. in work_mem.
This patch makes it consistent, so that "B" accepted in all the same
contexts where "kB", "MB", and so forth are accepted.

Add "B" to the list of accepted units in the error hint, along with "kB",
"MB", etc.

Add an entry in the conversion table for "TB" to "B" conversion. A terabyte
is out of range for any GUC_UNIT_BYTE option, so you always get an "out of
range" error with that, but without it, you get a confusing error message
that claims that "TB" is not an accepted unit, with a hint that nevertheless
lists "TB" as an accepted unit.

Reviewed-by: Alexander Korotkov, Andres Freund
Discussion: https://www.postgresql.org/message-id/1bfe7f4a-7e22-aa6e-7b37-f4d222ed2d67@iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b06d8e58b5ac257c2119312c47c4a0f233c5e0ca

Modified Files
--------------
src/backend/utils/misc/guc.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: pgsql: doc: PG 11 release notes fix for pg_dump --create, author
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix incorrect ordering of operations in pg_resetwal andpg_rewin