Re: Postgresql Software Location

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Postgresql Software Location
Date: 2024-08-29 18:58:53
Message-ID: CANzqJaAjUpPGKyR9G4gtA6FYM=-3Nuc8JZXs4FjJs4DZKMA47w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Thu, Aug 29, 2024 at 2:13 PM Henry Ashu <henry(dot)ashu(at)dat(dot)com> wrote:

> We have installed our postgresql software in this location:
>
> [postgres(at)testdbapql01 data]$ pwd
> /var/lib/pgsql/16/data
>

That directory is where I put the $PGDATA for a long time. Now I put it in
/Database/16/data. Why? Two reasons:
1. /var/lib/pgsql is usually postgres' $HOME, and I don't want to clutter
that up.
2. /Database makes it obvious to all concerned what's in it.

> [postgres(at)testbapql01 data]$ df -h .
> Filesystem Size Used Avail Use% Mounted on
> /dev/mapper/rhel-root 28G 4.5G 23G 17% /
> [postgres(at)testdbapql01 data]$
>
> Does this look correct?
>

"Correct" is relative. What other mount points are on that server (for
example, /var/log)? Having said that... I think it's a horrible idea.

> We are thinking that it should not be installed on the root filesystem
>

I would *never* put a database directory on the root filesystem. Some
other process outside of your control fills up root, and... poof, there
goes your database. (Postgresql doesn't like full mount points.)

We go with three mount points:
- /Database/${MajorVersion} (note the lack of "data"!)
- /Database/backups
- /var/log/postgresql (which $PGDATA/postgresql.conf log_directory points
to).

No separate mount point for pg_wal. I think that's a relic of the bygone
era of 300GB spindles (much less 300MB spindles). YMMV..

--
Death to America, and butter sauce.
Iraq lobster!

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Ron Johnson 2024-08-29 19:02:54 Re: Postgresql Database and PG_WAL locations
Previous Message Matthew Tice 2024-08-29 18:21:38 Re: Postgresql Database and PG_WAL locations