Re: Postgresql Software Location - Mailing list pgsql-admin

From Ron Johnson
Subject Re: Postgresql Software Location
Date
Msg-id CANzqJaAjUpPGKyR9G4gtA6FYM=-3Nuc8JZXs4FjJs4DZKMA47w@mail.gmail.com
Whole thread Raw
In response to Postgresql Software Location  (Henry Ashu <henry.ashu@dat.com>)
List pgsql-admin
On Thu, Aug 29, 2024 at 2:13 PM Henry Ashu <henry.ashu@dat.com> wrote:
We have installed our postgresql software in this location: 

[postgres@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@testbapql01 data]$ df -h .
Filesystem             Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root   28G  4.5G   23G  17% /
[postgres@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!

pgsql-admin by date:

Previous
From: Matthew Tice
Date:
Subject: Re: Postgresql Database and PG_WAL locations
Next
From: Ron Johnson
Date:
Subject: Re: Postgresql Database and PG_WAL locations