pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Luca Ferrari <fluca1978@gmail.com>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: question about zeroes in the wal file names
Date: Mon, 19 Aug 2019 09:30:06 +0200
Message-ID: <575bbf91-8666-f573-1d8b-6bfda5e39195@2ndquadrant.com> (raw)
In-Reply-To: <CAKoxK+67oS+PSygdmRHbn-GSjE_TY+t6Gzk6CRzcw-HVGswzOA@mail.gmail.com>
References: <CAKoxK+67oS+PSygdmRHbn-GSjE_TY+t6Gzk6CRzcw-HVGswzOA@mail.gmail.com>

On 2019-08-18 16:17, Luca Ferrari wrote:
> I'm just curious to better understand the naming convention behind wal
> files, because I've seen on a system of mine that the wals created
> were:
> 
> 000000050000020E000000FF
>  000000050000020F00000000
> 
> while I was expecting 20E0x100.

You are in principle correct.  This naming system is a historical
accident.  The actual LSN associated with the first file is

0000020EFF000000

and so the next one is naturally

0000020F00000000

The reason the zeroes are in there comes from a time when PostgreSQL
didn't fully support 64-bit integers, and the LSNs and the files were
tracked internally as pairs of 32-bit integers.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (3+ messages)

Message-ID: <575bbf91-8666-f573-1d8b-6bfda5e39195@2ndquadrant.com>
Permalink:  ../575bbf91-8666-f573-1d8b-6bfda5e39195@2ndquadrant.com/
Also on:    postgresql.org/message-id/575bbf91-8666-f573-1d8b-6bfda5e39195@2ndquadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: peter.eisentraut@2ndquadrant.com, fluca1978@gmail.com
  Subject: Re: question about zeroes in the wal file names
  In-Reply-To: <575bbf91-8666-f573-1d8b-6bfda5e39195@2ndquadrant.com>
  References: <CAKoxK+67oS+PSygdmRHbn-GSjE_TY+t6Gzk6CRzcw-HVGswzOA@mail.gmail.com> <575bbf91-8666-f573-1d8b-6bfda5e39195@2ndquadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox