0

I have question about Postgres xlog. According the Postgres documentation, the Postgres xlog should be in this format 0000000100000044000000FE, i don t understand why the xlog format is my database is 000000010000004400000**5**FE. The additional 5 from where it comes...

Here real database xlogs for postgres 9.4

cat PG_VERSION 9.4

ll pg_xlog/ | tail -n 10
-rw——- 1 postgres postgres 2097152 May 12 03:24 0000000100000044000005FE
-rw——- 1 postgres postgres 2097152 May 12 03:24 0000000100000044000005FF
-rw——- 1 postgres postgres 2097152 May 12 03:24 000000010000004400000600
-rw——- 1 postgres postgres 2097152 May 12 03:24 000000010000004400000601
-rw——- 1 postgres postgres 2097152 May 12 03:24 000000010000004400000602
-rw——- 1 postgres postgres 2097152 May 12 03:24 000000010000004400000603
-rw——- 1 postgres postgres 2097152 May 12 03:24 000000010000004400000604
-rw——- 1 postgres postgres 2097152 May 12 03:24 000000010000004400000605
-rw——- 1 postgres postgres 2097152 May 12 03:24 000000010000004400000606
drwx—— 2 postgres postgres 45056 May 12 15:10 archive_status/

Thank you in advance

1
  • 1
    There's nothing extra. It's a continuous number that goes up every time a new log is created. Commented May 15, 2017 at 3:58

1 Answer 1

0

There is nothing "weird" about the filenames. You correctly stated that the filename should be in that format (the actual names will be very different in reality).

Quote from the manual:

Segment files are given ever-increasing numbers as names, starting at 000000010000000000000000. The numbers do not wrap, but it will take a very, very long time to exhaust the available stock of numbers.

So the filename reflects an increasing number that has some structure in it. You can't expect any specific values in there, on a busy system they will simply keep increasing.

The first 8 digits (the 00000001) reflect the timeline of the WAL record if I am not mistaken, the rest the sequence number of the WAL record for that timeline.

Sign up to request clarification or add additional context in comments.

4 Comments

According to Postgres documentation the xlog file name, should start from 000000010000004400000000 and ends at 0000000100000044000000FF. A maximum of 255 segments per Xlog 0000000100000044. So, having this segment file name 0000000100000044000005FE, will be out of the rule.
@FadhelGhorbel: where did you find the reference that the name starts with 000000010000004400000000 and ends with 0000000100000044000000FF? The part I quoted clearly states that the file name starts with 000000010000000000000000 and an "end value" is not mentioned anywhere
Here the reference depesz.com/2011/07/14/…
@FadhelGhorbel That is not the "Postgres documentation". And nowhere there does it claim that the filename will "start" with 000000010000004400000000. All file names shown in that blog are only examples they do not imply any "limits" on what the numbers can be.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.