AW: Documentation for initdb option --waldir - Mailing list pgsql-docs

From Theodor Herlo
Subject AW: Documentation for initdb option --waldir
Date
Msg-id FR3P281MB19197329968C1F5D6537C6D5F6A12@FR3P281MB1919.DEUP281.PROD.OUTLOOK.COM
Whole thread Raw
In response to Re: Documentation for initdb option --waldir  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: Documentation for initdb option --waldir
List pgsql-docs
Both look great to me!  I thought the advantage of having different devices is also to easy I/O load. But I guess you
haveto decide for yourself what is the best strategy. For me it was important to know what initdb does with ---waldir.
Andthis is nicely explained here.  
One more little thing, I stumbled across " should not be a mount point", sounds thirst like it was not good to use the
mountpoint. Maybe: " should not be the mount point itself but a directory in the mount point". It might be only me, you
diced. 

Thank you very much!

Regards,
Theo

-----Ursprüngliche Nachricht-----
Von: Laurenz Albe <laurenz.albe@cybertec.at>
Gesendet: Donnerstag, 27. März 2025 11:32
An: David G. Johnston <david.g.johnston@gmail.com>; Theodor Herlo <t.herlo@proventa.de>;
pgsql-docs@lists.postgresql.org
Betreff: Re: Documentation for initdb option --waldir

[Sie erhalten nicht häufig E-Mails von laurenz.albe@cybertec.at. Weitere Informationen, warum dies wichtig ist, finden
Sieunter https://aka.ms/LearnAboutSenderIdentification ] 

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
growingdata 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



pgsql-docs by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Documentation for initdb option --waldir
Next
From: "Euler Taveira"
Date:
Subject: Re: Documentation for initdb option --waldir