Expending the use of xlog_internal.h's macros

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Expending the use of xlog_internal.h's macros
Date: 2015-06-10 05:41:14
Message-ID: CAB7nPqSiKU+8HjVe_J05btonC5E7kvmRaLpGS6EaEQe=Dy3jnQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

While looking at the code of pg_archivecleanup.c, I noticed that there
is some code present to detect if a given string has the format of a
WAL segment file name or of a backup file.
The recent commit 179cdd09 has introduced in xlog_internal.h a set of
macros to facilitate checks of pg_xlog's name format:
IsPartialXLogFileName(), IsXLogFileName() and IsTLHistoryFileName().

And by looking at the code, there are some utilities where we could
make use of that, like pg_resetxlog, pg_archivecleanup and pg_standby.

Attached is a small refactoring patch doing so for HEAD.
Regards,
--
Michael

Attachment Content-Type Size
20150610_xlog_macros.patch text/x-diff 7.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2015-06-10 05:57:22 Re: Restore-reliability mode
Previous Message Kouhei Kaigai 2015-06-10 04:42:33 [idea] table partition + hash join