Re: xlogfilename

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: DEV_OPS <devops(at)ww-it(dot)cn>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, computer_wg(at)163(dot)com
Subject: Re: xlogfilename
Date: 2017-07-20 09:02:25
Message-ID: CAB7nPqQ+OJDNFiXuMB-pEZGGUQyf2a6tu3EV7kPQ5Q2=xZ9NAg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 20, 2017 at 10:58 AM, DEV_OPS <devops(at)ww-it(dot)cn> wrote:
> I think you may reference to function: pg_xlogfile_name in
> src/backend/access/transam/xlogfuncs.c, it use XLogFileName defined in
> src/include/access/xlog_internal.h
>
> #define XLogFileName(fname, tli, logSegNo) \
> snprintf(fname, MAXFNAMELEN, "%08X%08X%08X", tli, \
> (uint32) ((logSegNo) / XLogSegmentsPerXLogId), \
> (uint32) ((logSegNo) % XLogSegmentsPerXLogId))
>
>
> hope it's helpful for you

The first 8 characters are the timeline number in hexadecimal format.
The next 8 characters indicate a segment number, which gets
incremented every 256 segments in hexa format. The last 8 characters
indicate the current segment number in hexa format.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2017-07-20 09:14:33 Re: Partition-wise join for join between (declaratively) partitioned tables
Previous Message DEV_OPS 2017-07-20 08:58:58 Re: xlogfilename