Re: [HACKERS] Proposal: GetOldestXminExtend for ignoring arbitrary vacuum flags

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Proposal: GetOldestXminExtend for ignoring arbitrary vacuum flags
Дата
Msg-id 17528.1487195874@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Proposal: GetOldestXminExtend for ignoring arbitraryvacuum flags  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2017-02-15 12:27:11 -0500, Robert Haas wrote:
>> I agree; also, many years ago a guy named Tom Lane told me that flags
>> argument should typically be declared as type "int".  I've followed
>> that advice ever since.

> Why is that?  I think uint makes a lot more sense for flags where the
> flags are individual bits that set/unset. Doing that with the sign bit
> isn't a good idea.

It would only matter if you got to the point of needing the sign bit
for a flag, which basically never happens for this sort of usage
(or if it does, you'd better be thinking about switching to int64
anyway).  So the extra mental and typing load of choosing some other
type than plain old "int" isn't really justified, IMO.

Anyway the real point is that "int" is preferable to "uint8" which
was the original choice here.  "uint8" unduly constrains the number
of flags you can add without an ABI break, and on many machines it's
more efficient to pass "int" function arguments than some other width.
        regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Patch to implement pg_current_logfile() function
Следующее
От: neha khatri
Дата:
Сообщение: Re: [HACKERS] bytea_output vs make installcheck