Re: Documentation for initdb option --waldir

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Robert Treat <rob(at)xzilla(dot)net>
Cc: Euler Taveira <euler(at)eulerto(dot)com>, Theodor Herlo <t(dot)herlo(at)proventa(dot)de>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "pgsql-docs(at)lists(dot)postgresql(dot)org" <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: Documentation for initdb option --waldir
Date: 2025-03-29 14:58:08
Message-ID: CAKFQuwb+=nXOWX54sxHRbzpRZtOswwNxZ0kKvHw9K74iDf7zQA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Saturday, March 29, 2025, Robert Treat <rob(at)xzilla(dot)net> wrote:

> On Thu, Mar 27, 2025 at 5:57 PM David G. Johnston
> <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> > On Thu, Mar 27, 2025 at 2:28 PM Robert Treat <rob(at)xzilla(dot)net> wrote:
> >> On Thu, Mar 27, 2025 at 12:06 PM David G. Johnston
> >> <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> >> > I expanded upon the material regarding using different file systems
> and disks.
> >> >
> >> > I would like to add a similar "why" to the mount point recommendation
> but don't know what that would be. Suggestions welcomed.
> >> >
> >>
> >
> > If I mount the filesystem on disk2 to: /mnt/disk2
> > Why do I need to create "/mnt/disk2/wal_files/" and point there instead
> of: "/mnt/disk2/"?
> >
>
> eventually came across this from
> https://www.postgresql.org/docs/devel/creating-cluster.
> html#CREATING-CLUSTER-MOUNT-POINTS
>
> "Best practice is to create a directory within the mount-point
> directory that is owned by the PostgreSQL user, and then create the
> data directory within that. This avoids permissions problems,..."
>
> Which I do remember having tried to do it directly and the OS
> complaining that my mount point wasn't owned by root and/or Postgres
> complaining that the xlog dir wasn't owned by Postgres, so I think
> this advice probably still holds.
>
>
Thank you, I can definitely work that in and it makes sense.

On the topic of verbosity, I found the wording for —pgdata in pg_basebackup
to support the more complete description.

https://www.postgresql.org/docs/current/app-pgbasebackup.html

I believe that at least documenting external side-effects should be
required. I’m less convinced that pre-conditions that will be checked by
the application need to be listed. But for now I’m going to copy
pg_basebackup as my example and at some point might get to doing a survey
and proposing a new standard wording for —waldir and —pgdata descriptions
regarding creation.

The comment regarding absolute paths will remain unwritten.

David J.

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Robert Treat 2025-03-29 15:18:45 Re: Documentation for initdb option --waldir
Previous Message Gurjeet Singh 2025-03-29 14:56:48 Re: Creating first database