From 2ffdc560e3af6e5f7e4f5b3430a36a8136443a24 Mon Sep 17 00:00:00 2001 From: Matthias Riegler Date: Wed, 21 Jun 2023 11:58:04 +0200 Subject: [PATCH 1/2] fix: rephrase the Postgres PGDATA documentation and add a warning The content of this PR should be self-explaining. Signed-off-by: Matthias Riegler --- postgres/content.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/postgres/content.md b/postgres/content.md index 1d2baf71a870..eb5c293b5888 100644 --- a/postgres/content.md +++ b/postgres/content.md @@ -96,7 +96,10 @@ See the PostgreSQL documentation on [`pg_hba.conf`](https://www.postgresql.org/d ### `PGDATA` -This optional variable can be used to define another location - like a subdirectory - for the database files. The default is `/var/lib/postgresql/data`. If the data volume you're using is a filesystem mountpoint (like with GCE persistent disks) or remote folder that cannot be chowned to the `postgres` user (like some NFS mounts), Postgres `initdb` recommends a subdirectory be created to contain the data. +> **Important Note:** when mounting a volume to `/var/lib/posgresql`, the `/var/lib/postgresql/data` path is a local volume from the container runtime, thus data is not persisted on the mounted volume. + +This optional variable can be used to define another location - like a subdirectory - for the database files. The default is `/var/lib/postgresql/data`. If the data volume you're using is a filesystem mountpoint (like with GCE persistent disks), or remote folder that cannot be chowned to the `postgres` user (like some NFS mounts), or contains folders/files (e.g. `lost+found`), Postgres `initdb` requires a subdirectory to be created within the mountpoint to contain the data. + For example: From 426cb6cc6d605bae0d6146e4d028414ebfe22dd3 Mon Sep 17 00:00:00 2001 From: Matthias Riegler Date: Sat, 24 Jun 2023 16:11:11 +0200 Subject: [PATCH 2/2] Update postgres/content.md Co-authored-by: Tianon Gravi --- postgres/content.md | 1 - 1 file changed, 1 deletion(-) diff --git a/postgres/content.md b/postgres/content.md index eb5c293b5888..622e21063276 100644 --- a/postgres/content.md +++ b/postgres/content.md @@ -100,7 +100,6 @@ See the PostgreSQL documentation on [`pg_hba.conf`](https://www.postgresql.org/d This optional variable can be used to define another location - like a subdirectory - for the database files. The default is `/var/lib/postgresql/data`. If the data volume you're using is a filesystem mountpoint (like with GCE persistent disks), or remote folder that cannot be chowned to the `postgres` user (like some NFS mounts), or contains folders/files (e.g. `lost+found`), Postgres `initdb` requires a subdirectory to be created within the mountpoint to contain the data. - For example: ```console