Re: pgbench randomness initialization

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Re: pgbench randomness initialization
Дата
Msg-id alpine.DEB.2.20.1803040921300.12500@lancre
обсуждение исходный текст
Ответ на Re: pgbench randomness initialization  (Chapman Flack <chap@anastigmatix.net>)
Ответы Re: Re: pgbench randomness initialization  (Chapman Flack <chap@anastigmatix.net>)
Список pgsql-hackers
Hello Chapman,

Here is v9.

> It needs s/explicitely/explicitly/ in the docs.

Done.

> The parsing of the seed involves matters of taste, I guess: if it were a 
> signed int, then sscanf's built-in %i would do everything those three 
> explicit hex/octal/decimal branches do, but there's no unsigned version 
> of %i. Then there's strtoul(..., base=0), which accepts the same choice 
> of bases, but there's no unsigned-int-width version of that. Maybe it 
> would still look cleaner to use strtoul and just check that the result 
> fits in unsigned int? As I began, it comes down to taste ... this code 
> does work.

I must admit that I'm not too happy with the result as well, so I dropped 
the octal/hexadecimal parsing.

> I am not sure about the "idem for :random_seed" part: Does this mean that a value
> could be given with -Drandom_seed on the command line, and become the value
> of :random_seed, possibly different from the value given to --random-seed?
> Is that intended? (Perhaps it is; I'm merely asking.)

The "idem" is about setting the variable but not overwritting it if it 
already exists. The intention is that :random_seed is the random seed, 
unless the user set it to something else in which case it is the user's 
value. I've improved the variable description in the doc to point out that 
the value may be overwritten with -D.

-- 
Fabien.
Вложения

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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: [PATCH] Verify Checksums during Basebackups
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: [HACKERS] Re: [COMMITTERS] pgsql: Remove pgbench "progress" testpending solution of its timing is (fwd)