Tighten up range checks for pg_resetwal arguments

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Tighten up range checks for pg_resetwal arguments
Дата
Msg-id 81adf5f3-36ad-4bcd-9ba5-1b95c7b7a807@iki.fi
обсуждение исходный текст
Список pgsql-hackers
While working on the 64-bit multixid offsets patch and commit 
94939c5f3a, I got a little annoyed by how lax pg_resetwal is about 
out-of-range values. These are currently accepted, for example:

# Negative XID
pg_resetwal -D data -x -1000

# XID larger than 2^32   (on some platforms)
pg_resetwal -D data -x 10000000000

The first attached patch tightens up the parsing to reject those.

The second attached patch is just refactoring. Currently, we use invalid 
values for the variables backing each of the options to mean "option was 
not given". I think it would be more clear to have separate boolean 
variables for that. I did that for the --multixact-ids option in commit 
f99e30149f already, because there was no unused value for multixid that 
we could use. This patch expands that to all the options.

- Heikki

Вложения

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