Re: Expending the use of xlog_internal.h's macros

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Expending the use of xlog_internal.h's macros
Date: 2015-07-02 01:51:29
Message-ID: CAB7nPqQu-98HtrgqzBeUQpFAqWHC5Qth2EDXwGXXiOLFj9089Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 2, 2015 at 10:37 AM, Fujii Masao wrote:
> On Wed, Jul 1, 2015 at 9:53 PM, Fujii Masao wrote:
>>>>>
>>>>> +/* Length of XLog file name */
>>>>> +#define XLOG_DATA_FNAME_LEN 24
>>>>>
>>>>> Shorten the name of this macro variable, to XLOG_FNAME_LEN,
>>>>> for more code readability.
>>>
>>> Thanks. You have more talent for naming than I do.
>>>
>>>>> Comments?
>>>
>>> Just reading it again, I think that XLogFileNameById should use
>>> MAXFNAMELEN, and that XLogFileName should call directly
>>> XLogFileNameById as both are doing the same operation like in the
>>> attached.
>>
>> We can refactor the code that way, but which looks a bit messy
>> at least to me. The original coding looks simpler and easier-readable,
>> so I'd like to adopt the original one here.
>>
>>> It seems also safer to use MAXFNAMELEN instead of MAXPGPATH
>>> for exclusiveCleanupFileName in pg_standby.c and pg_archivecleanup.c.
>>
>> Yep.
>
> Pushed. Thanks!

Thanks! I was going to send a patch with what you wanted but you just
beat me at it.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Rahila Syed 2015-07-02 02:00:51 Re: [PROPOSAL] VACUUM Progress Checker.
Previous Message Fujii Masao 2015-07-02 01:37:26 Re: Expending the use of xlog_internal.h's macros