Re: Is it OK to create a directory in PGDATA dir

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: rakeshkumar464 <rakeshkumar464(at)outlook(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Is it OK to create a directory in PGDATA dir
Date: 2017-10-19 20:25:25
Message-ID: 7140e6cc-70fa-eb61-23b8-b1a99a07e3d5@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

On 10/19/2017 09:58 PM, rakeshkumar464 wrote:
> In the container world, sometime the only persistent storage path
> (that is, storage outside container world) is PGDATA.>

I don't want to be the "You're doing it wrong!" guy, but you're doing it
wrong. If a container only gives you a single persistent storage path,
then don't use it as PGDATA directly, but create PGDATA as one of the
directories in that path. And create a directory for other stuff next to
it, not in the data directory.

>
> Is it fine to create a subdir inside PGDATA and store our stuff
> there, or will PG freak out seeing a foreign object.
>

PostgreSQL certainly does not check if there are unknown directories in
the data directory, and it will not crash and burn. But it causes all
sorts of problems, and it increases the probability of human error.

regards

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Igal @ Lucee.org 2017-10-19 21:49:32 Re: Is it OK to create a directory in PGDATA dir
Previous Message rakeshkumar464 2017-10-19 19:58:05 Is it OK to create a directory in PGDATA dir