Re: Documentation for initdb option --waldir

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, t(dot)herlo(at)proventa(dot)de, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Documentation for initdb option --waldir
Date: 2025-03-27 10:32:18
Message-ID: 1f38ffb000b9ead35702a63191c28f36e259c7d1.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Wed, 2025-03-26 at 17:34 -0700, David G. Johnston wrote:
> + <para>
> + The <filename>pg_wal</filename> subdirectory will always exist within the
> + data directory. This is where <productname>PostgreSQL</productname>
> + sends its write-ahead log (<acronym>WAL</acronym>) files.
> + Specifying the <option>--waldir</option> option turns this subdirectory entry
> + into a symbolic link. In general, this is only useful if the remote location
> + is on a different physical device. An existing directory must be empty and
> + should not be a mount point. The directory will be created
> + (including missing parents) if necessary.
> + </para>

I think that it is very valuable to have WAL on a different file system on the
same storage device. The idea is that growing data files cannot exhaust the
space available for WAL.

How about this:

There is always a <filename>pg_wal</filename> within the data directory.
By default, it is a directory where <productname>PostgreSQL</productname>
places its write-ahead log (<acronym>WAL</acronym>) segment files. If
you create the <acronym>WAL</acronym> location somewhere else using the option
<option>--waldir</option>, <filename>pg_wal</filename> will be created as
a symbolic link pointing to that <acronym>WAL</acronym> location.
If the directory already exists, it must be empty and should not be a mount
point. The directory will be created (including missing parents) if necessary.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Theodor Herlo 2025-03-27 11:40:49 AW: Documentation for initdb option --waldir
Previous Message David G. Johnston 2025-03-27 00:34:44 Re: Documentation for initdb option --waldir